From 44aac15fc937cb1663ad900d12e0dd73bfb2dfba Mon Sep 17 00:00:00 2001 From: Dovid Levine Date: Mon, 4 Nov 2024 19:19:23 +0200 Subject: [PATCH] fix: ensure `$current` cookie time is `int` in `wp_user_settings()` --- src/wp-includes/option.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/option.php b/src/wp-includes/option.php index 270b78ca1bf53..f84a41363dc3e 100644 --- a/src/wp-includes/option.php +++ b/src/wp-includes/option.php @@ -1700,7 +1700,7 @@ function wp_user_settings() { } $last_saved = (int) get_user_option( 'user-settings-time', $user_id ); - $current = isset( $_COOKIE[ 'wp-settings-time-' . $user_id ] ) ? preg_replace( '/[^0-9]/', '', $_COOKIE[ 'wp-settings-time-' . $user_id ] ) : 0; + $current = isset( $_COOKIE[ 'wp-settings-time-' . $user_id ] ) ? (int) preg_replace( '/[^0-9]/', '', $_COOKIE[ 'wp-settings-time-' . $user_id ] ) : 0; // The cookie is newer than the saved value. Update the user_option and leave the cookie as-is. if ( $current > $last_saved ) {