mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-12 04:05:53 +02:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user