Bugfix: SQL error with alerts search bar (#12329)

* Fix SQL-error on search bar

* restore escapes

Co-authored-by: Tony Murray <[email protected]>
This commit is contained in:
ottorei
2020-11-20 22:13:59 -06:00
committed by GitHub
co-authored by Tony Murray
parent c66d6493fa
commit a7e65be09d
+1 -1
View File
@@ -60,7 +60,7 @@ if (! $show_recovered) {
}
if (isset($searchPhrase) && ! empty($searchPhrase)) {
$where .= ' AND (`timestamp` LIKE ? OR `rule` LIKE ? OR `name` LIKE ? OR `hostname` LIKE ? OR `sysName` LIKE ?)';
$where .= ' AND (`alerts`.`timestamp` LIKE ? OR `rule` LIKE ? OR `name` LIKE ? OR `hostname` LIKE ? OR `sysName` LIKE ?)';
$param[] = "%$searchPhrase%";
$param[] = "%$searchPhrase%";
$param[] = "%$searchPhrase%";