From 2f099e9f5d9bc492d64c2108ddf471f843792dd3 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 9 Nov 2024 16:28:24 +0000 Subject: [PATCH] Coding Standards: Ensure cookie expiration value is an integer in `wp_update_user()`. This addresses an issue in `wp_update_user()`, where `time()` is subtracted from the `$logged_in_cookie['expiration']` of type `string`. Follow-up to [29043]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59377 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php index d078d3d0f8a85..f60dbe5d3fae2 100644 --- a/src/wp-includes/user.php +++ b/src/wp-includes/user.php @@ -2792,7 +2792,7 @@ function wp_update_user( $userdata ) { $remember = false; - if ( false !== $logged_in_cookie && ( $logged_in_cookie['expiration'] - time() ) > $default_cookie_life ) { + if ( false !== $logged_in_cookie && ( (int) $logged_in_cookie['expiration'] - time() ) > $default_cookie_life ) { $remember = true; }