Use wp_die() for WPDB bails. Send 500 response and no-cache headers so wp_die()s are not cached. props DD32. fixes #3471

git-svn-id: https://develop.svn.wordpress.org/trunk@6110 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith
2007-09-13 06:23:23 +00:00
parent 2e0f3b30e8
commit 5d12c48818
3 changed files with 15 additions and 32 deletions

View File

@@ -1240,13 +1240,17 @@ function wp_die( $message, $title = '' ) {
else
$admin_dir = 'wp-admin/';
if ( !did_action('admin_head') ) :
if ( !function_exists('did_action') || !did_action('admin_head') ) :
status_header(500);
nocache_headers();
header('Content-Type: text/html; charset=utf-8');
if ( empty($title) )
$title = __('WordPress › Error');
if ( empty($title) ){
if( function_exists('__') )
$title = __('WordPress › Error');
else
$title = 'WordPress › Error';
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">