diff --git a/src/wp-admin/setup-config.php b/src/wp-admin/setup-config.php index 9d6b8ffeb6..6274a1aa73 100644 --- a/src/wp-admin/setup-config.php +++ b/src/wp-admin/setup-config.php @@ -332,7 +332,7 @@ switch($step) { continue; } - if ( ! preg_match( '/^define\(\'([A-Z_]+)\',([ ]+)/', $line, $match ) ) + if ( ! preg_match( '/^define\(\s*\'([A-Z_]+)\',([ ]+)/', $line, $match ) ) continue; $constant = $match[1]; @@ -343,11 +343,11 @@ switch($step) { case 'DB_USER' : case 'DB_PASSWORD' : case 'DB_HOST' : - $config_file[ $line_num ] = "define('" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "');\r\n"; + $config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "' );\r\n"; break; case 'DB_CHARSET' : if ( 'utf8mb4' === $wpdb->charset || ( ! $wpdb->charset && $wpdb->has_cap( 'utf8mb4' ) ) ) { - $config_file[ $line_num ] = "define('" . $constant . "'," . $padding . "'utf8mb4');\r\n"; + $config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'utf8mb4' );\r\n"; } break; case 'AUTH_KEY' : @@ -358,7 +358,7 @@ switch($step) { case 'SECURE_AUTH_SALT' : case 'LOGGED_IN_SALT' : case 'NONCE_SALT' : - $config_file[ $line_num ] = "define('" . $constant . "'," . $padding . "'" . $secret_keys[$key++] . "');\r\n"; + $config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'" . $secret_keys[$key++] . "' );\r\n"; break; } }