Fixed warning due to default timestamp from Article being passed to wfTimestamp
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 20 Mar 2005 03:59:06 +0000 (03:59 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 20 Mar 2005 03:59:06 +0000 (03:59 +0000)
Warning was: gmmktime(): Windows does not support negative values for this function in <b>c:\\htdocs\\w\\includes\\GlobalFunctions.php</b> on line <b>1017</b>

includes/OutputPage.php

index 641d377..fee9e5e 100644 (file)
@@ -86,7 +86,10 @@ class OutputPage {
         */
        function checkLastModified ( $timestamp ) {
                global $wgLang, $wgCachePages, $wgUser;
-               $timestamp=wfTimestamp(TS_MW,$timestamp);
+               if ( !$timestamp || $timestamp == '19700101000000' ) {
+                       wfDebug( "CACHE DISABLED, NO TIMESTAMP\n" );
+                       return;
+               }
                if( !$wgCachePages ) {
                        wfDebug( "CACHE DISABLED\n", false );
                        return;
@@ -96,6 +99,7 @@ class OutputPage {
                        return;
                }
 
+               $timestamp=wfTimestamp(TS_MW,$timestamp);
                $lastmod = wfTimestamp( TS_RFC2822, max( $timestamp, $wgUser->mTouched ) );
 
                if( !empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) {