Page MenuHomePhabricator

mw.uri.encode with WIKI unexpectedly encodes /
Closed, ResolvedPublic

Description

Actual:

mw.logObject(mw.uri.encode('Metallica/Kill+\'+Em+All', 'WIKI'))
=Metallica%2FKill%2B%27%2BEm%2BAll

Expected - behavior should be exactly as urlencode:

{{urlencode:Metallica/Kill+'+Em+All|WIKI}}
=Metallica/Kill%2B%27%2BEm%2BAll

since mw.uri.encode doesn't work as expected one should bypass it and use frame:preprocess('{{urlencode:'..s..'|WIKI}}')

Details

Related Gerrit Patches:
mediawiki/extensions/Scribunto : masterMake mw.uri.encode 'WIKI' mode match core {{urlencode:}}

Event Timeline

eranroz created this task.Aug 26 2017, 9:15 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 26 2017, 9:15 AM
eranroz updated the task description. (Show Details)Aug 26 2017, 9:42 AM

Change 374329 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/extensions/Scribunto@master] Make mw.uri.encode 'WIKI' mode match core {{urlencode:}}

https://gerrit.wikimedia.org/r/374329

Change 374329 merged by jenkins-bot:
[mediawiki/extensions/Scribunto@master] Make mw.uri.encode 'WIKI' mode match core {{urlencode:}}

https://gerrit.wikimedia.org/r/374329

Anomie closed this task as Resolved.Aug 28 2017, 6:29 PM
Anomie claimed this task.
Anomie added a subscriber: Anomie.

This should be deployed to WMF wikis with 1.30.0-wmf.16, see https://www.mediawiki.org/wiki/MediaWiki_1.30/Roadmap for the schedule.