Skip to content

Commit

Permalink
Coding Standards: Ensure cookie expiration value is an integer in `wp…
Browse files Browse the repository at this point in the history
…_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
  • Loading branch information
SergeyBiryukov committed Nov 9, 2024
1 parent ca0435c commit 2f099e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wp-includes/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2f099e9

Please sign in to comment.