Page MenuHomePhabricator

Allow abuse filter variables to be injected to warning template
Open, Needs TriagePublic

Description

Currently the AbuseFilter can perform some checks and if required show a distinctive warning based on these checks. However, if a filter is designed to check multiple things, the warning is still static and cannot inform the user which check triggered the warning.

For example, on en-wiki Filter 869 is currently set up to warn against using a certain source (The Daily Mail). Users have requested that more sources are added that have been deprecated. However, the warning template can only warn that "a deprecated source" has been added, thus making it hard for the user to understand which addition actually triggered the filter. The only workaround is to create a filter for each source and have them call a static template each which is of course not a viable long-term solution.

Could the AF be modified to include an option in the "Warning" area to pass selected (custom) variables to the template that the template can then use to display information about the edit that triggered it? That way the filter could be modified to create a custom variable like "detected_source" that contains the information about the source the filter found and display this in the warning.

Event Timeline

Making it possible to specify variables for warning/disallow messages, and accepting dynamically computed AF vars as such is a concrete and easier to implement duplicate of T174554.

Aklapper renamed this task from AbuseFilter feature request: Allow variables to be used in a warning template to Allow variables to be used in a warning template.Feb 17 2019, 5:44 AM
Xaosflux renamed this task from Allow variables to be used in a warning template to Allow abuse filter variables to be injected to warning template.May 31 2019, 5:14 PM
Xaosflux subscribed.