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
This commit is contained in:
ryan 2007-05-07 23:24:44 +00:00
parent 481e505d49
commit bbad336b10
1 changed files with 8 additions and 4 deletions

View File

@ -1348,15 +1348,18 @@ function wp_die( $message, $title = '' ) {
$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');
if ( empty($title) )
$title = __('WordPress &rsaquo; 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">
@ -1371,6 +1374,7 @@ if ( ( $wp_locale ) && ('rtl' == $wp_locale->text_direction) ) : ?>
<?php endif; ?>
</head>
<body>
<?php endif; ?>
<h1 id="logo"><img alt="WordPress" src="<?php echo $admin_dir; ?>images/wordpress-logo.png" /></h1>
<?php echo $message; ?>