ids-functions.pl: Proper return N/A if no ruleset date could be

determined.

If no timestamp could be grabbed for rulestarball of a given provider,
return N/A.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
Stefan Schantl
2021-04-16 20:27:20 +02:00
parent 14696ced7e
commit 057e895351

View File

@@ -1512,15 +1512,15 @@ sub get_ruleset_date($) {
# Get timestamp the file creation.
my $mtime = $stat->mtime;
# Check if the timestamp has not been grabbed.
unless ($mtime) {
# Return N/A for Not available.
return "N/A";
}
# Convert into human read-able format.
$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;
}