From 871c6d2b45f1e5657ccf225db8814eadfd579837 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Thu, 23 Nov 2017 05:23:50 +0000 Subject: [PATCH] Setup: Allow for `wp-config-sample.php` to be formatted according to coding standards. When the setup process reads `wp-config-sample.php`, it assumes that there are no spaces inside the brackes of the `define()`s. Unfortunately, this doesn't match our coding standards, so will no longer work correctly once we start enforcing them. This also improves coding standards of the generated `wp-config.php` file. See #41057. Built from https://develop.svn.wordpress.org/trunk@42218 git-svn-id: http://core.svn.wordpress.org/trunk@42047 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/setup-config.php | 8 ++++---- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-admin/setup-config.php b/wp-admin/setup-config.php index 9d6b8ffeb6..6274a1aa73 100644 --- a/wp-admin/setup-config.php +++ b/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; } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 6908a35b04..4f31a3110c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-42217'; +$wp_version = '5.0-alpha-42218'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.