Changeset 10619 for trunk/wp-includes/classes.php
- Timestamp:
- 02/21/2009 09:39:06 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/classes.php
r10573 r10619 303 303 */ 304 304 function send_headers() { 305 @header('X-Pingback: '. get_bloginfo('pingback_url')); 305 $headers = array('X-Pingback' => get_bloginfo('pingback_url')); 306 $status = null; 306 307 if ( is_user_logged_in() ) 307 nocache_headers();308 $headers = array_merge($headers, wp_get_nocache_headers()); 308 309 if ( !empty($this->query_vars['error']) && '404' == $this->query_vars['error'] ) { 309 status_header( 404 );310 $status = 404; 310 311 if ( !is_user_logged_in() ) 311 nocache_headers();312 @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));312 $headers = array_merge($headers, wp_get_nocache_headers()); 313 $headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset'); 313 314 } else if ( empty($this->query_vars['feed']) ) { 314 @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));315 $headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset'); 315 316 } else { 316 317 // We're showing a feed, so WP is indeed the only thing that last changed … … 330 331 $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT'; 331 332 $wp_etag = '"' . md5($wp_last_modified) . '"'; 332 @header("Last-Modified: $wp_last_modified");333 @header("ETag: $wp_etag");333 $headers['Last-Modified'] = $wp_last_modified; 334 $headers['ETag'] = $wp_etag; 334 335 335 336 // Support for Conditional GET … … 348 349 (($client_modified_timestamp >= $wp_modified_timestamp) && ($client_etag == $wp_etag)) : 349 350 (($client_modified_timestamp >= $wp_modified_timestamp) || ($client_etag == $wp_etag)) ) { 350 status_header( 304 );351 exit;351 $status = 304; 352 add_action('send_headers', 'exit', 1); 352 353 } 353 354 } 355 356 $headers = apply_filters('wp_headers', $headers, $this); 357 358 if ( ! empty( $status ) ) 359 status_header( $status ); 360 foreach( (array) $headers as $name => $field_value ) 361 @header("{$name}: {$field_value}"); 354 362 355 363 do_action_ref_array('send_headers', array(&$this));
Note: See TracChangeset
for help on using the changeset viewer.