logs.cgi/ids.dat: Fixup processing dates from logfiles whichcontains a year

Message ID 20190316115725.5400-1-stefan.schantl@ipfire.org
State Accepted
Commit 7bf5b0f22194fcb617f3e678c4a1c492b0faf01d
Headers
Series logs.cgi/ids.dat: Fixup processing dates from logfiles whichcontains a year |

Commit Message

Stefan Schantl March 16, 2019, 10:57 p.m. UTC
  Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 html/cgi-bin/logs.cgi/ids.dat | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
  

Patch

diff --git a/html/cgi-bin/logs.cgi/ids.dat b/html/cgi-bin/logs.cgi/ids.dat
index e374f5711..1447a06f0 100644
--- a/html/cgi-bin/logs.cgi/ids.dat
+++ b/html/cgi-bin/logs.cgi/ids.dat
@@ -460,7 +460,14 @@  sub processevent
 			}
 		}
 		$line++;
-		unless ($line == 1 || $date ne "$monthstr/$daystr") { &append; }
+
+		# Split the date into single chunks.
+		my ($month, $day, $year) = split('/', $date);
+
+		# Check if all data is collected and the date of the event fits the desired date to
+		# get displayed.
+		if ($line gt 1 || "$month/$day" eq "$monthstr/$daystr") { &append; }
+
 		close(LOG);
 	}
 }