Exit gracefully with a warning if the table_prefix uses disallowed chars. fixes #3537
git-svn-id: https://develop.svn.wordpress.org/trunk@4695 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9d80a01cf6
commit
4a33cd1687
@ -100,6 +100,9 @@ else
|
||||
// $table_prefix is deprecated as of 2.1
|
||||
$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.'));
|
||||
|
||||
// Table names
|
||||
$wpdb->posts = $wpdb->prefix . 'posts';
|
||||
$wpdb->users = $wpdb->prefix . 'users';
|
||||
|
Loading…
Reference in New Issue
Block a user