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

* Fix SQL-error on search bar

* restore escapes

Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
ottorei 2020-11-21 06:13:59 +02:00 committed by GitHub
parent c66d6493fa
commit a7e65be09d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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%";