mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-14 09:44:44 +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 |
||
---|---|---|
.. | ||
parserTests | ||
phpunit | ||
legacyParserTest.php |