Last modified: 2012-09-16 07:30:22 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 T29972, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27972 - {{fullurl:}} does not urlencode passed querystring
{{fullurl:}} does not urlencode passed querystring
Status: REOPENED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.18.x
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: need-parsertest, parser
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-10 12:16 UTC by Danny B.
Modified: 2012-09-16 07:30 UTC (History)
5 users (show)

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


Attachments

Description Danny B. 2011-03-10 12:16:46 UTC
{{fullurl:foo|param=lorem ipsum}}
becomes
http://some.wiki.org/w/index.php?title=foo&param=lorem
instead of
http://some.wiki.org/w/index.php?title=foo&param=lorem%20ipsum

further dependency:

[{{fullurl:foo|param=lorem ipsum}} link name]
becomes
"ipsum link name" linking to http://some.wiki.org/w/index.php?title=foo&param=lorem
instead of
"link name" linking to http://some.wiki.org/w/index.php?title=foo&param=lorem%20ipsum
Comment 1 db [inactive,noenotif] 2011-03-11 18:17:18 UTC
You have to url-encode the param part your self, because MediaWiki does not know if a character must urlencoded or not (in some case it is bad to encode = or & or %).
But the first gives
http://some.wiki.org/w/index.php?title=foo&param=lorem ipsum
so there is no trim.
Comment 2 P.Copp 2011-03-14 16:31:01 UTC
Marking as INVALID per comment #1. The query string passed to fullurl as second argument is supposed to be urlencoded already. Encoding it again would break b/c on thousands of pages.
Comment 3 Tim Starling 2011-03-14 21:41:21 UTC
It would be possible to encode only the characters which are invalid in URLs, like spaces, similar to what a web browser does when you enter a URL.
Comment 4 Tim Starling 2011-03-14 21:54:36 UTC
Also, {{fullurl:}} shouldn't be sending invalid query strings through to
Title::getFullURL(), there should be some kind of validation on the input side.
Comment 5 db [inactive,noenotif] 2012-09-16 07:30:22 UTC
Against which list you want validate the query string? It is the current behaviour, that the second param of fullurl has to be a urlencoded string. Changing this can break b/c.

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


Navigation
Links