Make WordPress Core


Ignore:
Timestamp:
04/14/2005 12:09:52 AM (21 years ago)
Author:
matt
Message:

Logic was *really* confusing and it seemed to return 304s badly, breaking all dashboards when I updated the dev blog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-blog-header.php

    r2529 r2534  
    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                     }
    149                         exit;
     136        if ( $client_last_modified && $client_etag ) {
     137                if ( (strtotime($client_last_modified) <= strtotime($wp_last_modified)) || ($client_etag == $wp_etag) ) {
     138                        if ( preg_match('/cgi/',php_sapi_name()) ) {
     139                                 header('Status: 304 Not Modified');
     140                                 echo "\r\n\r\n";
     141                                 exit;
     142                        } else {
     143                                 if ( version_compare(phpversion(), '4.3.0', '>=') ) {
     144                                          header('Not Modified', TRUE, 304);
     145                                 } else {
     146                                          header('HTTP/1.x 304 Not Modified');
     147                                 }
     148                                exit;
     149                        }
    150150                }
    151151        }
Note: See TracChangeset for help on using the changeset viewer.