Last modified: 2011-11-17 22:04:04 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29876, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27876 - unnecessary things in mw.Uri.js
unnecessary things in mw.Uri.js
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
UploadWizard (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 27730
  Show dependency treegraph
 
Reported: 2011-03-05 20:24 UTC by Neil Kandalgaonkar
Modified: 2011-11-17 22:04 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Neil Kandalgaonkar 2011-03-05 20:24:52 UTC
Michael Dale has argued me into thinking that the following things about this class are overkill.

- Breaking down userinfo into user & password. Our primary use case is HTTP and URI passwords are actually illegal there anyway. Removing this will save several internal methods and tests when serializing the URI.

- The uri.clone() method, which is just sugar for another new() call

- having its own encode function -- there is such a function already in mediawiki.util.js, called rawurlencode , should standardize on that.

- should investigate whether jQuery.param() can replace the path serialization code (not sure if we can do that and also have the slightly custom encoding & decoding that mediawiki seems to like).

Arguably this bug is a request for "de-enhancement". But we need more people who think like that ;)
Comment 1 Neil Kandalgaonkar 2011-03-08 18:10:16 UTC
Re: rawurlencode:

Had a look at mediawiki.util.js -- it's got a lot of miscellaneous stuff and the dependencies pull in a lot of other jQuery modules. There are three methods which are URI-related 
 - rawurlencode
 - wikiurlencode
 - getParamValue

Seems to me that the right thing is actually to:
- move mw.Uri.js to be a new module, mediaWiki.uri.js, ideally no dependencies
- refactor rawurlencode, and a few other such methods, into mediaWiki.Uri.js.
- refactor/rethink getParamValue, it is way better to do 
    mw.Uri( currentUrl ).query[ 'name' ]

Also see bug #27730 which was discussing yet another method for url manipulation
Comment 2 Michael Dale 2011-03-08 19:40:40 UTC
I would add that it would be nice if mw.Uri more gracefully handles relative urls
Comment 3 Neil Kandalgaonkar 2011-03-08 21:50:01 UTC
@mdale - an example? You mean URLs with '..' in the path or URLs which are just paths, no protocol or host??
Comment 4 Bugmeister Bot 2011-08-19 19:12:38 UTC
Unassigning default assignments. http://article.gmane.org/gmane.science.linguistics.wikipedia.technical/54734
Comment 5 Neil Kandalgaonkar 2011-11-17 22:04:04 UTC
Fixed, and it handles relative urls too now.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links