mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 21:53:35 +00:00
84536df324
I'm not really sure why it exists; I assume to minimize overhead of init'ing multiple AbuseFilterParser objects that would be exactly the same. However, checkConditions() - which checks one specific condition - is not really an "endpoint" you will want to call in <your-extension-that-uses-AbuseFilter>. You're more likely to call something higher-lever (like AbuseFilter::filterAction, which will take care of fetching all appropriate filters, as well as run them through checkConditions, and much more). This will trickle down to ::checkAllFilter, down to ::checkFilter, which would eventually call ::checkConditions with the 'keepvars' argument. Basically, unless you're re-implementing much of AbuseFilter yourself, you won't get to pass anything other than 'keepvars' to checkFilter. As a result, even though you may call AbuseFilter to call on multiple different vars, it will re-use the same parser with the first vars. I'm proposing to drop the 'keepvars' and just keep the vars around instead. checkFilter can compare previous vars with new vars, and only init a new Parser if the vars are different. Change-Id: I96ccc60c77f3cdbb82c0f9f16782a1a44ffb1592 |
||
---|---|---|
api | ||
db_patches | ||
maintenance | ||
modules | ||
special | ||
tests | ||
Views | ||
.gitignore | ||
.gitreview | ||
.jshintrc | ||
AbuseFilter.alias.php | ||
AbuseFilter.class.php | ||
AbuseFilter.hooks.php | ||
AbuseFilter.i18n.php | ||
AbuseFilter.parser.php | ||
AbuseFilter.php | ||
abusefilter.tables.pg.sql | ||
abusefilter.tables.sql | ||
abusefilter.tables.sqlite.sql | ||
AbuseFilterVariableHolder.php | ||
AbuseLogHitFormatter.php | ||
composer.json | ||
hooks.txt |