]> git.mjollnir.org Git - s9y.git/commitdiff
Fix wrong timestamp generation when invalid archive dates are submitted, thanks to...
authorgarvinhicking <garvinhicking>
Mon, 18 Jun 2007 11:57:15 +0000 (11:57 +0000)
committergarvinhicking <garvinhicking>
Mon, 18 Jun 2007 11:57:15 +0000 (11:57 +0000)
index.php

index a9f33d5a66199117a7f95477a238ffe41d909b32..b7bb327eeda1367b2112a65cdd04e8c73a5abf20 100644 (file)
--- 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: