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
This commit is contained in:
parent
622bc51507
commit
3ae3baa8ff
@ -1348,15 +1348,18 @@ function wp_die( $message, $title = '' ) {
|
|||||||
$message = "<p>$message</p>";
|
$message = "<p>$message</p>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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');
|
header('Content-Type: text/html; charset=utf-8');
|
||||||
|
|
||||||
if ( empty($title) )
|
if ( empty($title) )
|
||||||
$title = __('WordPress › Error');
|
$title = __('WordPress › Error');
|
||||||
|
|
||||||
if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false)
|
|
||||||
$admin_dir = '';
|
|
||||||
else
|
|
||||||
$admin_dir = 'wp-admin/';
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
@ -1371,6 +1374,7 @@ if ( ( $wp_locale ) && ('rtl' == $wp_locale->text_direction) ) : ?>
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<?php endif; ?>
|
||||||
<h1 id="logo"><img alt="WordPress" src="<?php echo $admin_dir; ?>images/wordpress-logo.png" /></h1>
|
<h1 id="logo"><img alt="WordPress" src="<?php echo $admin_dir; ?>images/wordpress-logo.png" /></h1>
|
||||||
<?php echo $message; ?>
|
<?php echo $message; ?>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user