Fix wrong timestamp generation when invalid archive dates are submitted, thanks to Deminy
This commit is contained in:
parent
0447681d2d
commit
f82e869799
14
index.php
14
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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user