]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
ids-functions.pl: Proper return N/A if no ruleset date could be
authorStefan Schantl <stefan.schantl@ipfire.org>
Fri, 16 Apr 2021 18:27:20 +0000 (20:27 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sun, 19 Dec 2021 12:23:45 +0000 (13:23 +0100)
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>
config/cfgroot/ids-functions.pl

index b2e1a55200f295e9425f234b8e35603f696f4706..64d98a38823cfe5f78184bbbb3d83be9540caac7 100644 (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;
 }