From: Stefan Schantl Date: Wed, 14 Apr 2021 18:37:50 +0000 (+0200) Subject: ids-functions.pl: Return N/A if not date for a ruleset could be X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc685a36c54eb0882a7fdb14a8ec698dc83e4a86;p=people%2Fstevee%2Fipfire-2.x.git ids-functions.pl: Return N/A if not date for a ruleset could be determined. Signed-off-by: Stefan Schantl --- diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index 2af5534c95..b2e1a55200 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -1497,6 +1497,7 @@ END # sub get_ruleset_date($) { my ($provider) = @_; + my $date; # Load neccessary perl modules for file stat and to format the timestamp. use File::stat; @@ -1512,7 +1513,13 @@ sub get_ruleset_date($) { my $mtime = $stat->mtime; # Convert into human read-able format. - my $date = strftime('%Y-%m-%d %H:%M:%S', localtime($mtime)); + $date = strftime('%Y-%m-%d %H:%M:%S', localtime($mtime)); + + # Check if a date has been obtained. + unless ($date) { + # Assign N/A for Not available. + $date = "N/A"; + } # Return the date. return $date;