diff --git a/wp-admin/admin.php b/wp-admin/admin.php index 68e627c86b..b5ea5af0c6 100644 --- a/wp-admin/admin.php +++ b/wp-admin/admin.php @@ -5,7 +5,7 @@ else require_once('../wp-config.php'); if ( get_option('db_version') != $wp_db_version ) - die (sprintf(__("Your database is out-of-date. Please upgrade."), get_option('siteurl') . '/wp-admin/upgrade.php')); + wp_die(sprintf(__("Your database is out-of-date. Please upgrade."), get_option('siteurl') . '/wp-admin/upgrade.php')); require_once(ABSPATH . 'wp-admin/admin-functions.php'); require_once(ABSPATH . 'wp-admin/admin-db.php'); diff --git a/wp-includes/functions.php b/wp-includes/functions.php index f1c3243727..b0e389e9cc 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1115,4 +1115,68 @@ function wp_nonce_ays($action) { include_once(ABSPATH . '/wp-admin/admin-footer.php'); } +function wp_die($message) { + global $wpdb; + + if ( !$wpdb->show_errors ) + return false; + header('Content-Type: text/html; charset=utf-8'); + + $output = <<
+ + +$message
+ + +HEAD; + + $output = apply_filters('wp_die', $output, $message); + echo $output; + + die(); +} + ?>