Page MenuHomePhabricator

Special page slash parameters unpreditable and obfuscated to javascript
Open, LowPublicFeature

Description

Author: herd

Description:
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).


Version: 1.14.x
Severity: enhancement
URL: http://en.wikipedia.org/wiki/Special:ListUsers/rollbacker/s

Details

Reference
bz16462

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:28 PM
bzimport set Reference to bz16462.
bzimport added a subscriber: Unknown Object (MLST).
Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:01 AM
Aklapper removed a subscriber: wikibugs-l-list.