Skip to content

Commit

Permalink
Adapt fallback salts for WPCS
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera committed Jan 6, 2022
1 parent 4524ec1 commit a2733c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion features/config-create.feature
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Feature: Create a wp-config file
When I run `wp core config {CORE_CONFIG_SETTINGS}`
Then the wp-config.php file should contain:
"""
define('AUTH_SALT',
define( 'AUTH_SALT',
"""
Scenario: Define WPLANG when running WP < 4.0
Expand Down
3 changes: 3 additions & 0 deletions src/Config_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,9 @@ private static function fetch_remote_salts( $insecure = false ) {
WP_CLI::error( $exception );
}

// Adapt whitespace to adhere to WPCS.
$salts = preg_replace( '/define\(\'(.*?)\'\);/', 'define( \'$1\' );', $salts );

return $salts;
}

Expand Down

0 comments on commit a2733c1

Please sign in to comment.