diff --git a/html/ajax_rulesuggest.php b/html/ajax_rulesuggest.php
index 701ed49236..55a1fe1089 100644
--- a/html/ajax_rulesuggest.php
+++ b/html/ajax_rulesuggest.php
@@ -55,10 +55,12 @@ function levsort($base, $obj) {
}
$obj = array(array('name'=>'Error: No suggestions found.'));
+$term = array();
if( isset($_GET['term'],$_GET['device_id']) ) {
$chk = array();
$_GET['term'] = mres($_GET['term']);
$_GET['device_id'] = mres($_GET['device_id']);
+ $current == false;
if( strstr($_GET['term'],".") ) {
$term = explode(".",$_GET['term']);
if( $config['memcached']['enable'] ) {
@@ -95,6 +97,7 @@ if( isset($_GET['term'],$_GET['device_id']) ) {
$obj = levsort($_GET['term'],$chk);
$obj = array_chunk($obj,20,true);
$obj = $obj[0];
+ $flds = array();
if( $current == true ) {
foreach( $obj as $fld ) {
$flds[] = $fld['name'];
diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php
index c1554f3508..76eb2cb320 100644
--- a/html/includes/functions.inc.php
+++ b/html/includes/functions.inc.php
@@ -715,6 +715,7 @@ function is_admin() {
} else {
$allowed = false;
}
+ return $allowed;
}
?>
diff --git a/html/includes/print-alert-rules.php b/html/includes/print-alert-rules.php
index 2a7fae8ffc..9968ecc98f 100644
--- a/html/includes/print-alert-rules.php
+++ b/html/includes/print-alert-rules.php
@@ -49,6 +49,7 @@ echo('');
$rulei=1;
$count_query = "SELECT COUNT(id)";
$full_query = "SELECT *";
+$param = array();
if(isset($device['device_id']) && $device['device_id'] > 0) {
$sql = 'WHERE (device_id=? OR device_id="-1")';
$param = array($device['device_id']);
diff --git a/html/includes/print-alerts.php b/html/includes/print-alerts.php
index f312398be6..89be0cfea5 100644
--- a/html/includes/print-alerts.php
+++ b/html/includes/print-alerts.php
@@ -46,6 +46,8 @@ echo('');
$rulei=1;
$count_query = "SELECT COUNT(alerts.id)";
$full_query = "SELECT alerts.*, devices.hostname";
+$sql = '';
+$param = array();
if(isset($device['device_id']) && $device['device_id'] > 0) {
$sql = 'AND `alerts`.`device_id`=?';
$param = array($device['device_id']);