mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-09-25 03:08:16 +00:00
Bug 19604, backwards-compatibility issues with AbuseFilter count() function.
This commit is contained in:
parent
94a9b2b174
commit
2eafa9bd66
|
@ -1301,14 +1301,6 @@ class AbuseFilterParser {
|
|||
|
||||
if( $args[0]->type == AFPData::DList && count( $args ) == 1 ) {
|
||||
return new AFPData( AFPData::DInt, count( $args[0]->data ) );
|
||||
} elseif( count( $args ) > 1 && $args[1]->type == AFPData::DList ) {
|
||||
$needle = $args[0];
|
||||
$haystack = $args[1]->toList();
|
||||
$count = 0;
|
||||
foreach( $haystack as $item )
|
||||
if( AFPData::equals( $needle, $item ))
|
||||
$count++;
|
||||
return new AFPData( AFPData::DInt, $count );
|
||||
}
|
||||
|
||||
$offset = -1;
|
||||
|
|
Loading…
Reference in a new issue