From 6f656ab4e534a858c03c8c71f456556a0f67acaa Mon Sep 17 00:00:00 2001 From: Adam Silverstein Date: Fri, 11 Oct 2024 17:20:14 +0000 Subject: [PATCH] Users: remove unnecessary writes to the database for use_ssl user meta. When checking for updates to use_ssl, use strings for the comparison values, matching the stored values. Fixes an issue where calls to wp_update_user updated the database meta value for use_ssl even when the value was missing or unchanged. Props prettyboymp, rajinsharwar, adamsilverstein, johnbillion, rayhatron, mukesh27, joemcgill. Fixes #60299. Built from https://develop.svn.wordpress.org/trunk@59216 git-svn-id: http://core.svn.wordpress.org/trunk@58609 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index c8a87a3898..74f3ecba79 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -2366,7 +2366,7 @@ function wp_insert_user( $userdata ) { $admin_color = empty( $userdata['admin_color'] ) ? 'fresh' : $userdata['admin_color']; $meta['admin_color'] = preg_replace( '|[^a-z0-9 _.\-@]|i', '', $admin_color ); - $meta['use_ssl'] = empty( $userdata['use_ssl'] ) ? 0 : (bool) $userdata['use_ssl']; + $meta['use_ssl'] = empty( $userdata['use_ssl'] ) || ! $userdata['use_ssl'] ? '0' : '1'; $meta['show_admin_bar_front'] = empty( $userdata['show_admin_bar_front'] ) ? 'true' : $userdata['show_admin_bar_front']; diff --git a/wp-includes/version.php b/wp-includes/version.php index 817bde5cec..f33284ab1a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-beta2-59215'; +$wp_version = '6.7-beta2-59216'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.