mirror of
https://git.code.sf.net/p/quake/website
synced 2024-11-24 05:01:23 +00:00
Complete sanity checking for date search.
This commit is contained in:
parent
e4970a01f2
commit
d09b3dddef
1 changed files with 4 additions and 5 deletions
|
@ -194,13 +194,12 @@
|
|||
|
||||
function monthlyNews ($month, $year)
|
||||
{
|
||||
// Do sanity checking on dates
|
||||
if ($year < 2000) {
|
||||
$year = date ('Y', time ());
|
||||
if (($year < 1999) || ($year > date ('Y'))) { // Sanity checking
|
||||
$year = date ('Y');
|
||||
}
|
||||
|
||||
if ($month < 1 || $month > 12) {
|
||||
$month = date ('m', time ());
|
||||
if (($month < 1) || ($month > 12)) {
|
||||
$month = date ('m');
|
||||
}
|
||||
|
||||
$date = sprintf ("%04d-%02d", $year, $month);
|
||||
|
|
Loading…
Reference in a new issue