From 9bbd31c352bd9bba51508b40bfad9890a46731b9 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 16 Jun 2018 20:11:43 +0200 Subject: [PATCH] nieuws: strict year parsing, fallback to all --- nieuws/index.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/nieuws/index.php b/nieuws/index.php index 25efd2d..51cab26 100644 --- a/nieuws/index.php +++ b/nieuws/index.php @@ -12,7 +12,7 @@ if ($page and !is_numeric($page)) { if ($year) { ob_clean(); $title = "Nieuws"; - if (is_numeric($year)) { + if (is_numeric($year) and $year > 999) { $match = "$Page/$year/"; if (is_numeric($page)) { $title .= ' '.$monthname[intval($page)]; @@ -20,7 +20,7 @@ if ($year) { } $title .= ' '.$year; } - else { + elseif ($year === '19') { $match = "$Page/19??/"; $title .= " vóór 2000"; } @@ -32,10 +32,6 @@ if ($year) { return 1; } -if ($Args) { - return; -} - print '
'."\n\n"; foreach (array_reverse(glob("$Page/2???")) as $page) { @@ -45,7 +41,7 @@ foreach (array_reverse(glob("$Page/2???")) as $page) { } if ($pages = glob("$Page/19??/*.html")) { - printf('

%s

'."\n", "$Page/oud", 'Eerder'); + printf('

%s

'."\n", "$Page/19", 'Eerder'); printtoc($pages); } -- 2.30.0