Stop unslashing password while registering user

After 79ff1b10e password is not unslashed while logging in but
this missed removing `wp_unslash` from password while registering.
This causes the mismatch of password if user registered with a
password containing quote (`"`).
Fixes #23922.
This commit is contained in:
rmalviya 2019-06-13 18:24:17 +05:30
parent 9eca72849d
commit 01025f9628
1 changed files with 1 additions and 1 deletions

View File

@ -1091,7 +1091,7 @@ class WC_Form_Handler {
if ( isset( $_POST['register'], $_POST['email'] ) && wp_verify_nonce( $nonce_value, 'woocommerce-register' ) ) {
$username = 'no' === get_option( 'woocommerce_registration_generate_username' ) && isset( $_POST['username'] ) ? wp_unslash( $_POST['username'] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$password = 'no' === get_option( 'woocommerce_registration_generate_password' ) && isset( $_POST['password'] ) ? wp_unslash( $_POST['password'] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$password = 'no' === get_option( 'woocommerce_registration_generate_password' ) && isset( $_POST['password'] ) ? $_POST['password'] : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash
$email = wp_unslash( $_POST['email'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
try {