Last modified: 2014-11-17 10:36:24 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 16462 - Special page slash parameters unpreditable and obfuscated to javascript
Special page slash parameters unpreditable and obfuscated to javascript
Status: NEW
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.14.x
All All
: Low enhancement with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/wiki/Special:...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-26 04:43 UTC by Splarka
Modified: 2014-11-17 10:36 UTC (History)
1 user (show)

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


Attachments

Description Splarka 2008-11-26 04:43:54 UTC
Slash parameters for Special pages are very handy for wikilinking, but they can make user scripting very difficult. The slash is not included in wgTitle, and is not predictably findable in localized content languages. Also, some Special: pages now take multiple parameters, like ListUsers.

All of these parameters have an alias via GET, user= title= target= type= and such, but if a GET URI format is not used, this is not known to a script. Content can sometimes tell the parameter, such as on Contributions, the <input name="target">. But this again is very unreliable.

We would please like a javascript global, probably an object, exposing slash parameters on Special: pages, showing what parameters they get parsed as, and the normalized value. This may also aid debugging such parameters.

 http://en.wikipedia.org/wiki/Special:Log/rights -> var wgSpecialSlashParameters = {"type": "rights"};
 http://en.wikipedia.org/wiki/Special:WhatLinksHere/foo_bar -> var wgSpecialSlashParameters = {"target": "Foo bar"};
 http://en.wikipedia.org/wiki/Special:ListUsers/rollbacker/s -> var wgSpecialSlashParameters = {"username": "S", "group": "rollbacker"};

Normal GET parameters are of course very standard, so there would be no need to replicate these. A script could then check for 'type' in both GET and slash at once via:
if(queryString('type') || (wgSpecialSlashParameters && wgSpecialSlashParameters['type']))

So there would be no need to globalize those, just the slash, for example:

 http://en.wikipedia.org/wiki/Special:Log/rights?foo=bar&baz=baf -> var wgSpecialSlashParameters = {"type": "rights"};
 http://en.wikipedia.org/w/index.php?title=Special%3ALog%2Frights&foo=bar&baz=baf -> var wgSpecialSlashParameters = {"type": "rights"};


This could be applied to all GET parameters as well, but this would be a bit spammy and unnecessary. Javascript global pollution is getting out of hand a bit, and should be restricted to necessary cases (of which this is one, in our humble opinion).

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


Navigation
Links