Die with style. Props Sewar. fixes #2902

git-svn-id: http://svn.automattic.com/wordpress/trunk@3979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-07-05 19:13:26 +00:00
parent 7c774d0a1b
commit ae4cedc61a
2 changed files with 65 additions and 1 deletions

View File

@ -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 <a href='%s'>upgrade</a>."), get_option('siteurl') . '/wp-admin/upgrade.php'));
wp_die(sprintf(__("Your database is out-of-date. Please <a href='%s'>upgrade</a>."), get_option('siteurl') . '/wp-admin/upgrade.php'));
require_once(ABSPATH . 'wp-admin/admin-functions.php');
require_once(ABSPATH . 'wp-admin/admin-db.php');

View File

@ -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 = <<<HEAD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WordPress &rsaquo; Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style media="screen" type="text/css">
<!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, "Times New Roman", Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}
h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}
h2 {
font-size: 16px;
}
p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}
ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
-->
</style>
</head>
<body>
<h1 id="logo"><img alt="WordPress" src="../wp-admin/images/wordpress-logo.png" /></h1>
<p>$message</p>
</body>
</html>
HEAD;
$output = apply_filters('wp_die', $output, $message);
echo $output;
die();
}
?>