Exit gracefully with a warning if the table_prefix uses disallowed chars. table_prefix cleanup for wp-settings.php to jive with trunk and note impending deprecation of table_prefix. fixes #3537

git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2007-01-07 09:43:34 +00:00
parent 755316f391
commit 3f5472892f

View File

@ -71,19 +71,23 @@ if ( defined('WP_CACHE') )
define('WPINC', 'wp-includes');
require_once (ABSPATH . WPINC . '/wp-db.php');
// Table names
$wpdb->posts = $table_prefix . 'posts';
$wpdb->users = $table_prefix . 'users';
$wpdb->categories = $table_prefix . 'categories';
$wpdb->post2cat = $table_prefix . 'post2cat';
$wpdb->comments = $table_prefix . 'comments';
$wpdb->links = $table_prefix . 'links';
$wpdb->linkcategories = $table_prefix . 'linkcategories';
$wpdb->options = $table_prefix . 'options';
$wpdb->postmeta = $table_prefix . 'postmeta';
$wpdb->usermeta = $table_prefix . 'usermeta';
// $table_prefix will be deprecated in version 2.1
$wpdb->prefix = $table_prefix;
$wpdb->prefix = $table_prefix;
if ( preg_match('|[^a-z0-9_]|i', $wpdb->prefix) )
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';
$wpdb->users = $wpdb->prefix . 'users';
$wpdb->categories = $wpdb->prefix . 'categories';
$wpdb->post2cat = $wpdb->prefix . 'post2cat';
$wpdb->comments = $wpdb->prefix . 'comments';
$wpdb->links = $wpdb->prefix . 'links';
$wpdb->linkcategories = $wpdb->prefix . 'linkcategories';
$wpdb->options = $wpdb->prefix . 'options';
$wpdb->postmeta = $wpdb->prefix . 'postmeta';
$wpdb->usermeta = $wpdb->prefix . 'usermeta';
if ( defined('CUSTOM_USER_TABLE') )
$wpdb->users = CUSTOM_USER_TABLE;