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}}')

Event Timeline

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 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.