Last modified: 2013-01-14 17:09:14 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 T42442, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40442 - {{PAGENAME}} and like does nothing with url-encoded title
{{PAGENAME}} and like does nothing with url-encoded title
Status: REOPENED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Lowest minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 22553 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-22 10:40 UTC by François
Modified: 2013-01-14 17:09 UTC (History)
5 users (show)

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


Attachments

Description François 2012-09-22 10:40:50 UTC
Hello!

All is in the title; for example
<code>{{PAGENAME:Fran%C3%A7ois}}</code> returns nothing.
Comment 1 Platonides 2012-09-22 10:48:23 UTC
The magic word is {{PAGENAME}}, which returns the name of the current page.
Comment 2 Liangent 2012-09-22 10:55:25 UTC
(In reply to comment #1)
> The magic word is {{PAGENAME}}, which returns the name of the current page.

It's also a parser function defined in CoreParserFunctions.php.
Comment 3 db [inactive,noenotif] 2012-09-26 17:56:38 UTC
these parser functions does not do decoding of the input and titles with percent sequence are invalid.
Comment 4 Krinkle 2012-09-26 18:34:03 UTC
"Fran%C3%A7ois" is an invalid page title.

https://en.wikipedia.org/wiki/Fran%25C3%25A7ois

Will respond with "Bad title".

This parser function works on titles, not urls. There is no reason for this function to expect url encoding, it is wikitext/html, not a url.

If we do decoding in this parser function, it means certain titles would have to be explicitly encoded, that would make things fail.

Marking INVALID, as it is not a bug, it is designed to take valid titles, not url portions. And making it accept url portions will likely break in unexpected ways. Just fix the wikitext to pass the actual page name, why would you put url encodings in wikitext anyway?
Comment 5 Liangent 2012-09-26 22:51:08 UTC
(In reply to comment #4)
> If we do decoding in this parser function, it means certain titles would have
> to be explicitly encoded, that would make things fail.

Nothing would fail because we already do decoding in [[ ]] syntax -- that is, [[Fran%C3%A7ois]] links to https://en.wikipedia.org/wiki/Fran%C3%A7ois , and a urlencoded form is never a valid title.
Comment 6 db [inactive,noenotif] 2012-09-29 19:33:42 UTC
*** Bug 22553 has been marked as a duplicate of this bug. ***

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


Navigation
Links