From: garvinhicking Date: Mon, 18 Jun 2007 11:57:15 +0000 (+0000) Subject: Fix wrong timestamp generation when invalid archive dates are submitted, thanks to... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=fb985ec5bbd77e138114f2aa35dc84ec45ce6426;p=s9y.git Fix wrong timestamp generation when invalid archive dates are submitted, thanks to Deminy --- diff --git a/index.php b/index.php index a9f33d5..b7bb327 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: