mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 06:03:49 +00:00
5fc30112c7
substr_count() is just as fast as looped strpos() when there are no matches, and gets faster as the number of matches increases. Note that this introduces a small change in behavior when the needle is composed of repeated substrings, e.g. 'asdasdasd' or 'aa', and haystack is such that the needle can be matched in overlapping positions, e.g. 'asdasdasdasd' or 'aaaaa'. The old implementation counted overlapping matches, the new one doesn't. I don't think this behavior was intentional and I don't think this change will cause any real problems. Change-Id: Icc905ca34bf08d63e969787a5e3c119d498bf878 |
||
---|---|---|
api | ||
db_patches | ||
i18n | ||
maintenance | ||
modules | ||
special | ||
tests | ||
Views | ||
.gitignore | ||
.gitreview | ||
.jshintignore | ||
.jshintrc | ||
AbuseFilter.alias.php | ||
AbuseFilter.class.php | ||
AbuseFilter.hooks.php | ||
AbuseFilter.parser.php | ||
AbuseFilter.php | ||
abusefilter.tables.pg.sql | ||
abusefilter.tables.sql | ||
abusefilter.tables.sqlite.sql | ||
AbuseFilterTokenizer.php | ||
AbuseFilterVariableHolder.php | ||
AbuseLogHitFormatter.php | ||
composer.json | ||
COPYING | ||
Gruntfile.js | ||
hooks.txt | ||
package.json | ||
phpcs.xml |