What is the problem?
Currently, --consequence="block" will return filters which have the blockautopromote consequence.
This is because we do a substring match.
Steps to reproduce problem
- On a wiki with AbuseFilter installed, create two filters with Special:AbuseFilter/new
- One with Revoke the user's autoconfirmed status checked in the Actions to take when matched section
- The other with Block the user and/or IP address from editing checked instead
- Go to Special:AbuseFilter, find the two filters you just created and make a note of their Filter IDs
- Run the SearchFilters.php maintenance script with the --consequence="block" parameter
- Locally on bare metal, run php maintenance/run.php AbuseFilter:SearchFilters.php --consequence="block"
- On docker, run docker compose exec mediawiki php maintenance/run.php AbuseFilter:SearchFilters.php --consequence="block"
- On beta (if you have access), run mwscript extensions/AbuseFilter/maintenance/SearchFilters --wiki=enwiki --consequence="block"
Expected behaviour: Response lists the ID of the filter you created with Block the user and/or IP address from editing consequence, but not the other filter
Observed behaviour: Response lists the IDs of both filters you created
Environment
Wiki(s): https://en.wikipedia.beta.wmflabs.org Abuse Filter – (aee25cf) 10:19, 27 August 2024.