diff --git a/includes/alerts.inc.php b/includes/alerts.inc.php index 9e4c767b8..fe0699706 100644 --- a/includes/alerts.inc.php +++ b/includes/alerts.inc.php @@ -69,8 +69,10 @@ function GenSQL($rule) { //Cannot resolve glue-chain. Rule is invalid. return false; } + $last = ""; + $qry = ""; foreach( $gtmp as $glue ) { - if( !$last ) { + if( empty($last) ) { list($tmp,$last) = explode('.',$glue); $qry .= $glue.' = '; } else {