From 8e674037bc958f8c16ecf8b2c7e9e143956644b0 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 25 Oct 2012 20:38:55 +0000 Subject: [PATCH] Avoid 'headers already sent' messages for header_remove() the same way we currently do with header(). props ryan. fixes #22258. git-svn-id: https://develop.svn.wordpress.org/trunk@22303 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/class-wp.php | 2 +- wp-includes/functions.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp.php b/wp-includes/class-wp.php index c47679fbe4..b1b1e2876e 100644 --- a/wp-includes/class-wp.php +++ b/wp-includes/class-wp.php @@ -382,7 +382,7 @@ class WP { @header("{$name}: {$field_value}"); if ( isset( $headers['Last-Modified'] ) && empty( $headers['Last-Modified'] ) && function_exists( 'header_remove' ) ) - header_remove( 'Last-Modified' ); + @header_remove( 'Last-Modified' ); if ( $exit_required ) exit(); diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 4a6e0a3b89..a589297edf 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -927,7 +927,7 @@ function nocache_headers() { foreach( $headers as $name => $field_value ) @header("{$name}: {$field_value}"); if ( empty( $headers['Last-Modified'] ) && function_exists( 'header_remove' ) ) - header_remove( 'Last-Modified' ); + @header_remove( 'Last-Modified' ); } /**