Page MenuHomePhabricator

Templates not handled well in title blacklist messages
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

I initiate an edit, move, or creation that triggers the title blacklist.

What happens?:

The message is displayed but the regex cuts off the template.

image.png (761×1 px, 177 KB)

Observe the first message code https://en.wikipedia.org/w/index.php?title=MediaWiki:Titleblacklist-forbidden-edit&oldid=1182427439&action=raw and the second message https://en.wikipedia.org/w/index.php?title=MediaWiki:Titleblacklist-forbidden-move&oldid=1086843935&action=raw. This is caused by MediaWiki not escaping the pipes.

What should have happened instead?:

MediaWiki should have escaped the pipe and equal signs when passing the regex, resulting in the full message being displayed.

Please also see https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)/Archive_184#Escaping_a_pipe_character_in_system_messages. I was going to do a Lua module to work around this, but after reading the documentation, Lua does not preserve parameter order.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Change 971307 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/extensions/TitleBlacklist@master] Escape raw title blacklist entry for wikitext when used in messages

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

Change 971307 merged by jenkins-bot:

[mediawiki/extensions/TitleBlacklist@master] Escape raw title blacklist entry for wikitext when used in messages

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

Umherirrender claimed this task.