Login and Registration: Slash email address when updating an existing user.

Addresses an issue with password reset keys when the email address contains special characters such as apostrophes.

Props emirpprime, rajinsharwar, fnpen, hellofromTonya, oglekler, nicolefurlan.
Fixes #52529.
Built from https://develop.svn.wordpress.org/trunk@57711


git-svn-id: http://core.svn.wordpress.org/trunk@57212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Pascal Birchler 2024-02-26 10:43:06 +00:00
parent 4096795c61
commit 60b72e87d7
2 changed files with 4 additions and 1 deletions

View File

@ -2096,6 +2096,9 @@ function wp_insert_user( $userdata ) {
return new WP_Error( 'invalid_user_id', __( 'Invalid user ID.' ) ); return new WP_Error( 'invalid_user_id', __( 'Invalid user ID.' ) );
} }
// Slash current user email to compare it later with slashed new user email.
$old_user_data->user_email = wp_slash( $old_user_data->user_email );
// Hashed in wp_update_user(), plaintext if called directly. // Hashed in wp_update_user(), plaintext if called directly.
$user_pass = ! empty( $userdata['user_pass'] ) ? $userdata['user_pass'] : $old_user_data->user_pass; $user_pass = ! empty( $userdata['user_pass'] ) ? $userdata['user_pass'] : $old_user_data->user_pass;
} else { } else {

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.5-beta2-57710'; $wp_version = '6.5-beta2-57711';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.