Page MenuHomePhabricator

Abusefilter does not substitute $1 with the filter name when using templates
Closed, InvalidPublic

Description

On the Dutch Wikipedia, the message that is displayed when a filter triggers does not substitute $1 with the name of the filter when the text "$1" is included in a template on the relevant MediaWiki page. It does work when $1 is included on the MediaWiki page itself.

To reproduce this issue:

When the filter is triggered, $1 is not substituted with the filter name. In our case, the message "Het automatische controlesysteem heeft uw bewerking tegengehouden om de volgende reden: $1." is displayed like that. It should have displayed "Het automatische controlesysteem heeft uw bewerking tegengehouden om de volgende reden: Minimale kwaliteit." (per https://nl.wikipedia.org/wiki/Speciaal:Filter/104).

To see this bug "in the field", edit the Dutch Wikipedia as an anonymous user, create a new page and try to save the page with just the text "This edit does not meet the minimum quality rule and is blocked automatically."

Event Timeline

Daimona subscribed.

This is not a bug with AbuseFilter, but how messages work in MediaWiki, since message parameters are not passed to templates. The right way to do that is:

MediaWiki:Abusefilter-disallowed-kwaliteit
{{Misbruikfilter-verhinderen-kwaliteit|$1}}
Template:Misbruikfilter-verhinderen-kwaliteit
Here is the name: {{{1}}}