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: http://svn.automattic.com/wordpress/trunk@6110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith
2007-09-13 06:23:23 +00:00
parent 9e61170004
commit b36471d4cf
3 changed files with 15 additions and 32 deletions

View File

@@ -113,6 +113,10 @@ if ( !defined('LANGDIR') ) {
if ( !defined('PLUGINDIR') )
define('PLUGINDIR', 'wp-content/plugins'); // no leading slash, no trailing slash
require (ABSPATH . WPINC . '/compat.php');
require (ABSPATH . WPINC . '/functions.php');
if ( file_exists(ABSPATH . 'wp-content/db.php') )
require_once (ABSPATH . 'wp-content/db.php');
else
@@ -122,7 +126,7 @@ else
$wpdb->prefix = $table_prefix;
if ( preg_match('|[^a-z0-9_]|i', $wpdb->prefix) && !file_exists(ABSPATH . 'wp-content/db.php') )
die("<strong>ERROR</strong>: <code>$table_prefix</code> in <code>wp-config.php</code> can only contain numbers, letters, and underscores.");
wp_die("<strong>ERROR</strong>: <code>$table_prefix</code> in <code>wp-config.php</code> can only contain numbers, letters, and underscores.");
// Table names
$wpdb->posts = $wpdb->prefix . 'posts';
@@ -151,9 +155,6 @@ else
wp_cache_init();
require (ABSPATH . WPINC . '/compat.php');
require (ABSPATH . WPINC . '/functions.php');
require (ABSPATH . WPINC . '/classes.php');
require (ABSPATH . WPINC . '/plugin.php');
require (ABSPATH . WPINC . '/default-filters.php');