From 77bd517187eadcca5557b565762634e0b318bcec Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Mon, 18 Jun 2007 11:57:15 +0000 Subject: [PATCH] Fix wrong timestamp generation when invalid archive dates are submitted, thanks to Deminy --- index.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index a9f33d5a..b7bb327e 100644 --- a/index.php +++ b/index.php @@ -137,7 +137,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range $serendipity['GET']['action'] = 'read'; $serendipity['GET']['hidefooter'] = true; - if ( !isset($year) ) { + if (!isset($year)) { $year = date('Y'); $month = date('m'); $day = date('j'); @@ -145,6 +145,18 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range $serendipity['GET']['hidefooter'] = null; } + if (isset($year) && !is_numeric($year)) { + $year = date('Y'); + } + + if (isset($month) && !is_numeric($month)) { + $month = date('m'); + } + + if (isset($day) && !is_numeric($day)) { + $day = date('d'); + } + switch($serendipity['calendar']) { case 'gregorian': default: