Add RegEx support to alert rules and device groups

This commit is contained in:
f0o
2015-09-26 17:30:19 +00:00
parent c0f384a2d8
commit 407afd022a
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ function GenSQL($rule) {
}
$i++;
}
$sql = "SELECT * FROM ".implode(",",$tables)." WHERE (".$join."".str_replace("(","",$tables[0]).".device_id = ?) && (".str_replace(array("%","@","!~","~"),array("","%","NOT LIKE","LIKE"),$rule).")";
$sql = "SELECT * FROM ".implode(",",$tables)." WHERE (".$join."".str_replace("(","",$tables[0]).".device_id = ?) && (".str_replace(array("%","@","!~","~"),array("",".*","NOT REGEXP","REGEXP"),$rule).")";
return $sql;
}