Ticket #1323: wp-blog-header.diff
| File wp-blog-header.diff, 1.4 KB (added by , 21 years ago) |
|---|
-
wp-blog-header.php
old new 128 128 @header('X-Pingback: ' . get_bloginfo('pingback_url')); 129 129 130 130 // Support for Conditional GET 131 if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) $client_last_modified = $_SERVER['HTTP_IF_MODIFIED_SINCE'];132 else $client_last_modified = false;133 131 if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) $client_etag = stripslashes($_SERVER['HTTP_IF_NONE_MATCH']); 134 132 else $client_etag = false; 135 133 134 $client_last_modified = trim($_SERVER['HTTP_IF_MODIFIED_SINCE']); 135 // If string is empty, return 0. If not, attempt to parse into a timestamp 136 $client_modified_timestamp = $client_last_modified ? strtotime($client_last_modified) : 0; 137 138 // Make a timestamp for our most recent modification... 139 $wp_modified_timestamp = strtotime($wp_last_modified); 140 136 141 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)) ) {142 (($client_modified_timestamp >= $wp_modified_timestamp) && ($client_etag == $wp_etag)) : 143 (($client_modified_timestamp >= $wp_modified_timestamp) || ($client_etag == $wp_etag)) ) { 139 144 if ( preg_match('/cgi/',php_sapi_name()) ) { 140 145 header('Status: 304 Not Modified'); 141 146 echo "\r\n\r\n";