From bf1009091ba86bc15c924e1139f6ab839a4bd0aa Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Fri, 27 Jun 2008 09:11:59 +0000 Subject: [PATCH] Add contains to the list of operators --- AbuseFilter.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AbuseFilter.class.php b/AbuseFilter.class.php index 8d90bdca8..23b55cc70 100644 --- a/AbuseFilter.class.php +++ b/AbuseFilter.class.php @@ -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; }