Ticket #22258: 22258.2.diff
File 22258.2.diff, 2.0 KB (added by , 12 years ago) |
---|
-
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' => gmdate( 'D, d M Y H:i:s' ) . ' GMT',905 'Last-Modified' => '', 906 906 'Cache-Control' => 'no-cache, must-revalidate, max-age=0', 907 907 'Pragma' => 'no-cache', 908 908 ); … … 926 926 $headers = wp_get_nocache_headers(); 927 927 foreach( $headers as $name => $field_value ) 928 928 @header("{$name}: {$field_value}"); 929 if ( function_exists('header_remove') ) 930 header_remove( 'Last-Modified' ); 929 931 } 930 932 931 933 /** -
wp-includes/class-wp.php
320 320 $headers = array('X-Pingback' => get_bloginfo('pingback_url')); 321 321 $status = null; 322 322 $exit_required = false; 323 $nocache_headers = false; 323 324 324 if ( is_user_logged_in() ) 325 if ( is_user_logged_in() ) { 325 326 $headers = array_merge($headers, wp_get_nocache_headers()); 327 $nocache_headers = true; 328 } 329 326 330 if ( ! empty( $this->query_vars['error'] ) ) { 327 331 $status = (int) $this->query_vars['error']; 328 332 if ( 404 === $status ) { 329 if ( ! is_user_logged_in() ) 333 if ( ! is_user_logged_in() ) { 330 334 $headers = array_merge($headers, wp_get_nocache_headers()); 335 $nocache_headers = true; 336 } 331 337 $headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset'); 332 338 } elseif ( in_array( $status, array( 403, 500, 502, 503 ) ) ) { 333 339 $exit_required = true; … … 381 387 foreach( (array) $headers as $name => $field_value ) 382 388 @header("{$name}: {$field_value}"); 383 389 390 if ( $nocache_headers && function_exists('header_remove') ) 391 header_remove('Last-Modified'); 392 384 393 if ( $exit_required ) 385 394 exit(); 386 395