Exit gracefully with a warning if the table_prefix uses disallowed chars. fixes #3537
git-svn-id: http://svn.automattic.com/wordpress/trunk@4695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e2412eaaf2
commit
cde68f9336
|
@ -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