Validate Table Prefix in wp-config.php generator. Props johnl1479. Fixes #12622
git-svn-id: https://develop.svn.wordpress.org/trunk@13853 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6cd731abb4
commit
65b33d2608
|
@ -157,7 +157,12 @@ switch($step) {
|
||||||
$passwrd = trim($_POST['pwd']);
|
$passwrd = trim($_POST['pwd']);
|
||||||
$dbhost = trim($_POST['dbhost']);
|
$dbhost = trim($_POST['dbhost']);
|
||||||
$prefix = trim($_POST['prefix']);
|
$prefix = trim($_POST['prefix']);
|
||||||
if (empty($prefix)) $prefix = 'wp_';
|
if ( empty($prefix) )
|
||||||
|
$prefix = 'wp_';
|
||||||
|
|
||||||
|
// Validate $prefix: it can only contain letters, numbers and underscores
|
||||||
|
if ( preg_match( '|[^a-z0-9_]|i', $prefix ) )
|
||||||
|
wp_die( /*WP_I18N_BAD_PREFIX*/'<strong>ERROR</strong>: "Table Prefix" can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/ );
|
||||||
|
|
||||||
// Test the db connection.
|
// Test the db connection.
|
||||||
/**#@+
|
/**#@+
|
||||||
|
|
Loading…
Reference in New Issue