Add contains to the list of operators

This commit is contained in:
Andrew Garrett 2008-06-27 09:11:59 +00:00
parent 554f8ff412
commit bf1009091b

View file

@ -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;
}