From bbad336b1008511bb8862049720cfc011d7dbadc Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 7 May 2007 23:24:44 +0000 Subject: [PATCH] Don't send header from wp_die() if admin header already sent. fixes #4234 for 2.3. git-svn-id: http://svn.automattic.com/wordpress/trunk@5411 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 97cb86af84..5c5c2a5849 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1348,15 +1348,18 @@ function wp_die( $message, $title = '' ) { $message = "

$message

"; } + if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) + $admin_dir = ''; + else + $admin_dir = 'wp-admin/'; + + if ( !did_action('admin_head') ) : header('Content-Type: text/html; charset=utf-8'); if ( empty($title) ) $title = __('WordPress › Error'); - if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) - $admin_dir = ''; - else - $admin_dir = 'wp-admin/'; + ?> @@ -1371,6 +1374,7 @@ if ( ( $wp_locale ) && ('rtl' == $wp_locale->text_direction) ) : ?> +

WordPress