]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
logs.cgi/ids.dat: Dont display/export empty events.
authorStefan Schantl <stefan.schantl@ipfire.org>
Thu, 6 Sep 2018 11:28:20 +0000 (13:28 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Thu, 6 Sep 2018 12:04:17 +0000 (14:04 +0200)
Check if the current processed event has at least datetime and a title.
Otherwise skip it.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/logs.cgi/ids.dat

index fba1cbc195e03c0813abd34c6f010efd351edb65..21737511f8bc2ad7e17c7a59878ac9f2d586404b 100644 (file)
@@ -167,6 +167,10 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'export'})
        {
                my ($datetime,$title,$priority,$classification,$srcip,$srcport,$destip,$destport,$sid,$refs) = split(/\|/);
                $refs =~ s/,$//;
+
+               # Skip event if no datetime and title are available.
+               next unless (($datetime) && ($title));
+
                print "Date: $datetime\n";
                print "Name: $title\n";
                print "Priority: $priority\n";
@@ -285,6 +289,10 @@ foreach $_ (@slice)
        else {
                print "<tr bgcolor='$color{'color22'}'><td>\n"; }
        my ($datetime,$title,$priority,$classification,$srcip,$srcport,$destip,$destport,$sid,$refs) = split(/\|/);
+
+       # Only show the current event if at least datetime and title are available.
+       next unless (($datetime) && ($title));
+
        print <<END
 <table width='100%'>
 <tr>