Skip to content

Commit ec99254

Browse files
Copilotswissspidy
andcommitted
Fix: Apply wp_slash() to admin password in wp core install
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 9d52a34 commit ec99254

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

features/core-install.feature

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,22 @@ Feature: Install WordPress core
177177
"""
178178
And the return code should be 0
179179
180+
Scenario: Install WordPress with special characters in the admin password
181+
Given an empty directory
182+
And WP files
183+
And wp-config.php
184+
And a database
185+
186+
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`
187+
Then STDOUT should contain:
188+
"""
189+
Success: WordPress installed successfully.
190+
"""
191+
And the return code should be 0
192+
193+
When I run `wp user check-password wpcli 'R^^CzY;G"iZ@]H9b,'`
194+
Then the return code should be 0
195+
180196
@less-than-php-7
181197
Scenario: Install WordPress with locale set to de_DE on WP < 4.0
182198
Given an empty directory

src/Core_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ function wp_new_blog_notification() {
700700
}
701701

702702
$public = true;
703-
$password = $args['admin_password'];
703+
$password = wp_slash( $args['admin_password'] );
704704

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

0 commit comments

Comments
 (0)