From 17b27fa6186a981f18b465514b6851730cc1c208 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Sat, 28 Feb 2009 09:30:46 +0000 Subject: [PATCH] Make the exit call explicit so that it works. Fixes #9248. git-svn-id: https://develop.svn.wordpress.org/trunk@10672 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/classes.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/classes.php b/wp-includes/classes.php index 9b5efd7af4..f01e46b0b7 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -304,6 +304,8 @@ class WP { function send_headers() { $headers = array('X-Pingback' => get_bloginfo('pingback_url')); $status = null; + $exit_required = false; + if ( is_user_logged_in() ) $headers = array_merge($headers, wp_get_nocache_headers()); if ( !empty($this->query_vars['error']) && '404' == $this->query_vars['error'] ) { @@ -349,7 +351,7 @@ class WP { (($client_modified_timestamp >= $wp_modified_timestamp) && ($client_etag == $wp_etag)) : (($client_modified_timestamp >= $wp_modified_timestamp) || ($client_etag == $wp_etag)) ) { $status = 304; - add_action('send_headers', 'exit', 1); + $exit_required = true; } } @@ -360,6 +362,9 @@ class WP { foreach( (array) $headers as $name => $field_value ) @header("{$name}: {$field_value}"); + if ($exit_required) + exit(); + do_action_ref_array('send_headers', array(&$this)); }