Fix/31582 special characters in password on checkout page lead to not working account (#43777)

* Fix registration during checkout

* Added changelog.

* Moved changelog.

* Added correct spacing

* Move password slashing into WC_Checkout:get_posted_data()

* Lint fix
This commit is contained in:
Paulo Arromba 2024-01-31 09:36:58 +00:00 committed by GitHub
parent c704ae2cab
commit 1e815751ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
Fixed a bug affecting registration during checkout that would prevent a new user from logging in.

View File

@ -783,6 +783,9 @@ class WC_Checkout {
$value = wc_sanitize_textarea( $value );
break;
case 'password':
if ( $data['createaccount'] && 'account_password' === $key ) {
$value = wp_slash( $value ); // Passwords are encrypted with slashes on account creation, so we need to slash here too.
}
break;
default:
$value = wc_clean( $value );