From: Mischa POSLAWSKY Date: Fri, 15 Jun 2018 11:26:17 +0000 (+0200) Subject: nieuws: ignore non-numeric month requests X-Git-Tag: v3.1~1 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/ba6c22ab7c2f350603f3c1510be7ead7ddbadc3a nieuws: ignore non-numeric month requests Minor code cleanup to prevent PHP warnings. --- diff --git a/nieuws/index.php b/nieuws/index.php index 05c995a..25efd2d 100644 --- a/nieuws/index.php +++ b/nieuws/index.php @@ -11,14 +11,18 @@ if ($page and !is_numeric($page)) { if ($year) { ob_clean(); + $title = "Nieuws"; if (is_numeric($year)) { - $title = "Nieuws ".($page ? $monthname[$page].' ' : '').$year; $match = "$Page/$year/"; - if ($page) $match .= sprintf('%02d-', $page); + if (is_numeric($page)) { + $title .= ' '.$monthname[intval($page)]; + $match .= sprintf('%02d-', $page); + } + $title .= ' '.$year; } else { - $title = "Nieuws vóór 2000"; $match = "$Page/19??/"; + $title .= " vóór 2000"; } print "

$title

\n\n";