Make WordPress Core

Ticket #1356: 1356.1.patch

File 1356.1.patch, 1.5 KB (added by anonymousbugger, 20 years ago)
  • \wordpress\wp-blog-header.php

    old new  
    133133        if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) $client_etag = stripslashes($_SERVER['HTTP_IF_NONE_MATCH']);
    134134        else $client_etag = false;
    135135
    136         if ( ($client_last_modified && $client_etag) ?
    137                 ((strtotime($client_last_modified) >= strtotime($wp_last_modified)) && ($client_etag == $wp_etag)) :
    138                 ((strtotime($client_last_modified) >= strtotime($wp_last_modified)) || ($client_etag == $wp_etag)) ) {
    139                 if ( preg_match('/cgi/',php_sapi_name()) ) {
    140                         header('Status: 304 Not Modified');
    141                         echo "\r\n\r\n";
    142                         exit;
    143                 } else {
    144                         if ( version_compare(phpversion(), '4.3.0', '>=') )
    145                                 header('Not Modified', TRUE, 304);
    146                         else
    147                                 header('HTTP/1.x 304 Not Modified');
    148                         exit;
     136        if ($client_last_modified || $client_etag) {
     137                if ( ($client_last_modified && $client_etag) ?
     138                        ((strtotime($client_last_modified) >= strtotime($wp_last_modified)) && ($client_etag == $wp_etag)) :
     139                        ((strtotime($client_last_modified) >= strtotime($wp_last_modified)) || ($client_etag == $wp_etag)) ) {
     140                        if ( preg_match('/cgi/',php_sapi_name()) ) {
     141                                header('Status: 304 Not Modified');
     142                                echo "\r\n\r\n";
     143                                exit;
     144                        } else {
     145                                if ( version_compare(phpversion(), '4.3.0', '>=') )
     146                                        header('Not Modified', TRUE, 304);
     147                                else
     148                                        header('HTTP/1.x 304 Not Modified');
     149                                exit;
     150                        }
    149151                }
    150152        }
    151153}