From 3fb700cd6493e055f6a36a95b48b168152c3128d Mon Sep 17 00:00:00 2001 From: michelvaldrighi Date: Fri, 21 May 2004 22:33:47 +0000 Subject: [PATCH] don't translate months and weekdays in date strings PLUS bugfix for 304 Not Modified on PHP CGI git-svn-id: https://develop.svn.wordpress.org/trunk@1338 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-blog-header.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/wp-blog-header.php b/wp-blog-header.php index ab078855ce..20fd4407b9 100644 --- a/wp-blog-header.php +++ b/wp-blog-header.php @@ -82,7 +82,7 @@ if (!isset($doing_rss) || !$doing_rss) { } else { // We're showing a feed, so WP is indeed the only thing that last changed - $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT')).' GMT'; + $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT'; $wp_etag = '"'.md5($wp_last_modified).'"'; @header('Last Modified: '.$wp_last_modified); @header('ETag: '.$wp_etag); @@ -97,9 +97,17 @@ if (!isset($doing_rss) || !$doing_rss) { if ( ($client_last_modified && $client_etag) ? (($client_last_modified == $wp_last_modified) && ($client_etag == $wp_etag)) : (($client_last_modified == $wp_last_modified) || ($client_etag == $wp_etag)) ) { - header('HTTP/1.1 304 Not Modified'); - echo "\r\n\r\n"; - exit; + if ( preg_match('/cgi/',php_sapi_name()) ) { + header('HTTP/1.1 304 Not Modified'); + echo "\r\n\r\n"; + exit; + } else { + if (version_compare(phpversion(),'4.3.0','>=')) { + header('Not Modified', TRUE, 304); + } else { + header('HTTP/1.x 304 Not Modified'); + } + } } }