From 60b72e87d747a5e3d4b2bc49c1a8575404377c56 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Mon, 26 Feb 2024 10:43:06 +0000 Subject: [PATCH] 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 --- wp-includes/user.php | 3 +++ wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index 5d8cd9f57c..301e8f0fcb 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -2096,6 +2096,9 @@ function wp_insert_user( $userdata ) { 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. $user_pass = ! empty( $userdata['user_pass'] ) ? $userdata['user_pass'] : $old_user_data->user_pass; } else { diff --git a/wp-includes/version.php b/wp-includes/version.php index c8f874d6fd..b594f6bf74 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @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.