Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions features/core-install.feature
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,22 @@ Feature: Install WordPress core
"""
And the return code should be 0

Scenario: Install WordPress with special characters in the admin password
Given an empty directory
And WP files
And wp-config.php
And a database

When I run `wp core install --url=localhost:8001 --title=Test --admin_user=wpcli --admin_email=wpcli@example.org --admin_password='R^^CzY;G"iZ@]H9b,' --skip-email`
Then STDOUT should contain:
"""
Success: WordPress installed successfully.
"""
And the return code should be 0

When I run `wp user check-password wpcli 'R^^CzY;G"iZ@]H9b,' --escape-chars`
Then the return code should be 0

# This test downgrades to an older WordPress version, but the SQLite plugin requires 6.0+
@require-mysql
Scenario: Install WordPress with locale set to de_DE on WP >= 4.0
Expand Down
6 changes: 5 additions & 1 deletion src/Core_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,12 +704,16 @@ function wp_new_blog_notification() {
}

$public = true;
$password = $args['admin_password'];
$password = wp_slash( $args['admin_password'] );

if ( ! is_email( $args['admin_email'] ) ) {
WP_CLI::error( "The '{$args['admin_email']}' email address is invalid." );
}

/**
* @var string $password
*/

$result = wp_install(
$args['title'],
$args['admin_user'],
Expand Down