Fixed Perl Warning with undefined var

(cherry picked from commit c176286a09ae10b0054bfc410e61ad0fe1b6e696)
This commit is contained in:
mdtrooper 2015-02-04 14:07:09 +01:00
parent ded628da3e
commit c975f1b724

View File

@ -338,6 +338,11 @@ sub pandora_evaluate_alert ($$$$$$$;$$$) {
# '0001' means every year.
my $date_every_year = sprintf("0001%02d%02d", $mon + 1, $mday);
my $special_day = get_db_value ($dbh, 'SELECT same_day FROM talert_special_days WHERE (date = ? OR date = ?) AND (id_group = 0 OR id_group = ?) ORDER BY date DESC', $date, $date_every_year, $alert->{'id_group'});
if (!defined($special_day)) {
$special_day = '';
}
if ($special_day ne '') {
logger ($pa_config, $date . " is a special day for " . $alert->{'name'} . ". (as a " . $special_day . ")", 10);
return 1 if ($alert->{$special_day} != 1);