Ticket #23021: 23021-3.patch
| File 23021-3.patch, 2.2 KB (added by azaozz, 5 months ago) |
|---|
-
wp-includes/class-wp.php
346 346 || !empty($this->query_vars['attachment_id']) 347 347 ) 348 348 ) 349 ) 349 ) { 350 350 $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastcommentmodified('GMT'), 0).' GMT'; 351 else351 } else { 352 352 $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT'; 353 } 353 354 $wp_etag = '"' . md5($wp_last_modified) . '"'; 354 355 $headers['Last-Modified'] = $wp_last_modified; 355 356 $headers['ETag'] = $wp_etag; 356 357 357 358 // Support for Conditional GET 358 if ( isset($_SERVER['HTTP_IF_NONE_MATCH']))359 if ( isset($_SERVER['HTTP_IF_NONE_MATCH']) ) 359 360 $client_etag = stripslashes(stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])); 360 else $client_etag = false; 361 else 362 $client_etag = false; 361 363 362 364 $client_last_modified = empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? '' : trim($_SERVER['HTTP_IF_MODIFIED_SINCE']); 363 365 // If string is empty, return 0. If not, attempt to parse into a timestamp … … 378 380 379 381 if ( ! empty( $status ) ) 380 382 status_header( $status ); 381 foreach( (array) $headers as $name => $field_value ) 383 384 foreach( (array) $headers as $name => $field_value ) { 382 385 @header("{$name}: {$field_value}"); 386 } 383 387 384 if ( isset( $headers['Last-Modified'] ) && empty( $headers['Last-Modified'] ) && function_exists( 'header_remove' ) )385 @header_remove( 'Last-Modified' );386 387 388 if ( $exit_required ) 388 389 exit(); 389 390 -
wp-includes/functions.php
902 902 function wp_get_nocache_headers() { 903 903 $headers = array( 904 904 'Expires' => 'Wed, 11 Jan 1984 05:00:00 GMT', 905 'Last-Modified' => '',906 905 'Cache-Control' => 'no-cache, must-revalidate, max-age=0', 907 906 'Pragma' => 'no-cache', 908 907 ); … … 926 925 $headers = wp_get_nocache_headers(); 927 926 foreach( $headers as $name => $field_value ) 928 927 @header("{$name}: {$field_value}"); 929 if ( empty( $headers['Last-Modified'] ) && function_exists( 'header_remove' ) )930 @header_remove( 'Last-Modified' );931 928 } 932 929 933 930 /**
