Complete sanity checking for date search.

This commit is contained in:
Jeff Teunissen 2001-05-06 03:52:41 +00:00
parent e4970a01f2
commit d09b3dddef

View file

@ -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);