mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 21:53:35 +00:00
Add contains to the list of operators
This commit is contained in:
parent
554f8ff412
commit
bf1009091b
|
@ -41,7 +41,7 @@ class AbuseFilter {
|
|||
|
||||
public static function checkConditions( $conds, $vars ) {
|
||||
$modifierWords = array( 'norm', 'supernorm', 'lcase', 'length' );
|
||||
$operatorWords = array( 'eq', 'neq', 'gt', 'lt', 'regex' );
|
||||
$operatorWords = array( 'eq', 'neq', 'gt', 'lt', 'regex', 'contains' );
|
||||
$validJoinConditions = array( '!', '|', '&' );
|
||||
|
||||
// Remove leading/trailing spaces
|
||||
|
@ -211,7 +211,7 @@ class AbuseFilter {
|
|||
} elseif ($operator == 'regex') {
|
||||
return preg_match( $parameters, $value );
|
||||
} elseif ($operator == 'contains') {
|
||||
return strpos( $value, $parameters );
|
||||
return strpos( $value, $parameters ) !== false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue