Fix wrong timestamp generation when invalid archive dates are submitted, thanks to Deminy

This commit is contained in:
Garvin Hicking 2007-06-18 11:57:15 +00:00
parent 0447681d2d
commit f82e869799

View File

@ -137,7 +137,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
$serendipity['GET']['action'] = 'read'; $serendipity['GET']['action'] = 'read';
$serendipity['GET']['hidefooter'] = true; $serendipity['GET']['hidefooter'] = true;
if ( !isset($year) ) { if (!isset($year)) {
$year = date('Y'); $year = date('Y');
$month = date('m'); $month = date('m');
$day = date('j'); $day = date('j');
@ -145,6 +145,18 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
$serendipity['GET']['hidefooter'] = null; $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']) { switch($serendipity['calendar']) {
case 'gregorian': case 'gregorian':
default: default: