Page MenuHomePhabricator

Strange urlencode error
Open, LowPublic

Description

Author: FT2.wiki

Description:
I'm not sure where this stems from. In fact Im not sure if it's mediawiki, parser functions or just a "you shouldn't be trying to do that".

Basically I wanted a system message to include a link to the delete log of the relevant article. The pagename is provided in "$1", and I wanted the system message to include "[{{urlencode:$1}} $1]" as a link. Poor coding perhaps, but as the message allowed piped links I had hopes it might work.

The revision of the system message is here:
http://en.wikipedia.org/w/index.php?title=MediaWiki:Missing-article&oldid=289791845

I then clicked the link for an oversighted revision http://en.wikipedia.org/w/index.php?diff=289767780&oldid=289682224 to see if it worked.

The piping worked, as in, the resulting error gave the correct (piped) display name. But the URL it hyperlinked to was http://en.wikipedia.org/w/index.php?title=Special:Log&type=delete&page=%7FUNIQ2013e14f31611b6d-nowiki-00000001-QINU%7F

Something's not quite right there....


Version: unspecified
Severity: normal

Details

Reference
bz18794

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:37 PM
bzimport added a project: ParserFunctions.
bzimport set Reference to bz18794.
bzimport added a subscriber: Unknown Object (MLST).

<TimStarling> you can't urlencode a URL
<TimStarling> oh right, you're skipping the rest of the URL
<TimStarling> good fun
<TimStarling> presumably the article name is wrapped in <nowiki>
<TimStarling> I seem to remember that was done in a few messages

FT2.wiki wrote:

Noting the same error occurs for:
[{{fullurl:Special:Log|type=delete&page={{urlencode:$1}}}} blah]
as well.

The piped text is fine, the hyperlink points to:
http://en.wikipedia.org/w/index.php?title=Special:Log&type=delete&page=%7FUNIQ47869a6929f0a2d4-nowiki-00000001-QINU%7F

FT2.wiki wrote:

{{fullurl:Special:Log|type=delete&page=$1}} didn't work either

Dalba added a subscriber: Dalba.EditedJul 26 2016, 6:14 AM

T24555 is a related, more general form of this issue, that contains more info.