From 3ae3baa8ff8dfa874181d872464c7235fb1bb256 Mon Sep 17 00:00:00 2001 From: Ryan Boren 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: https://develop.svn.wordpress.org/trunk@5411 602fd350-edb4-49c9-b593-d223f7449a82 --- 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