Use one sql query to fetch device alert rules (#8391)

* Use one sql query to fetch device alert rules
Rename $device to $device_id to avoid confusion.  I didn't see any variable collisions.

* don't return disabled rules

* remove semi-colin
This commit is contained in:
Tony Murray
2018-03-15 11:03:45 -05:00
committed by Neil Lathwood
parent aec567f890
commit 72752fa2d0
2 changed files with 28 additions and 29 deletions

View File

@@ -101,6 +101,7 @@ function dbQuery($sql, $parameters = array())
$fullSql = dbMakeQuery($sql, $parameters);
if ($debug) {
if (php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) {
$fullSql = str_replace(PHP_EOL, '', $fullSql);
if (preg_match('/(INSERT INTO `alert_log`).*(details)/i', $fullSql)) {
echo "\nINSERT INTO `alert_log` entry masked due to binary data\n";
} else {