diff --git a/etemplate/inc/class.so_sql.inc.php b/etemplate/inc/class.so_sql.inc.php index b5c5d94ff7..5ad11af703 100644 --- a/etemplate/inc/class.so_sql.inc.php +++ b/etemplate/inc/class.so_sql.inc.php @@ -665,7 +665,7 @@ class so_sql if ($criteria[$col][0] == '!') { $cmp_op = ' NOT'.$cmp_op; - $criteria[$col] = '('.substr($criteria[$col],1).' OR '.$criteria[$col].' IS NULL)'; + $criteria[$col] = substr($criteria[$col],1); $negate = true; } $query[] = ($negate ? ' ('.$db_col.' IS NULL OR ' : '').$db_col.$cmp_op.$this->db->quote($wildcard.str_replace(array('%','_','*','?'),array('\\%','\\_','%','_'),$criteria[$col]).$wildcard).($negate ? ') ' : '');