From d973208bdb4b6d3f5551db530644b22c12080f76 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 4 Jul 2005 22:06:39 +0000 Subject: [PATCH] * Workaround for mysterious problem with bogus epoch If-Last-Modified reqs --- RELEASE-NOTES | 1 + includes/OutputPage.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b5f26a5ed0..4761a8af77 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -468,6 +468,7 @@ of MediaWiki:Newpagetext) to &action=edit, if page is new. * Removed language conversion support from Icelandic * (bug 2616) Fix proportional image scaling, giving correct height * (bug 2640) Include width and height attributes on unscaled images +* Workaround for mysterious problem with bogus epoch If-Last-Modified reqs === Caveats === diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 336539bd92..1316919ca0 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -113,7 +113,8 @@ class OutputPage { # Wed, 20 Aug 2003 06:51:19 GMT; length=5202 # this breaks strtotime(). $modsince = preg_replace( '/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"] ); - $ismodsince = wfTimestamp( TS_MW, strtotime( $modsince ) ); + $modsinceTime = strtotime( $modsince ); + $ismodsince = wfTimestamp( TS_MW, $modsinceTime ? $modsinceTime : 1 ); wfDebug( "-- client send If-Modified-Since: " . $modsince . "\n", false ); wfDebug( "-- we might send Last-Modified : $lastmod\n", false ); if( ($ismodsince >= $timestamp ) && $wgUser->validateCache( $ismodsince ) ) { -- 2.20.1