From e0c4e5b610bd0453b649f02c514f6eadc059e5be Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Tue, 15 Jan 2019 06:33:50 +0000 Subject: [PATCH] Users: Correct the default value in `setup_userdata()`. The `$for_user_id` parameter is an `int`, not a `string`, so the default value should be `0`, rather than an empty string. Props subrataemfluence. Fixes #44697. Built from https://develop.svn.wordpress.org/trunk@44603 git-svn-id: http://core.svn.wordpress.org/trunk@44434 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user.php | 6 +++--- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index d0b760986c..8bc44ae233 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -1005,12 +1005,12 @@ function count_users( $strategy = 'time', $site_id = null ) { * @global string $user_url The url in the user's profile * @global string $user_identity The display name of the user * - * @param int $for_user_id Optional. User ID to set up global data. + * @param int $for_user_id Optional. Default 0. User ID to set up global data. */ -function setup_userdata( $for_user_id = '' ) { +function setup_userdata( $for_user_id = 0 ) { global $user_login, $userdata, $user_level, $user_ID, $user_email, $user_url, $user_identity; - if ( '' == $for_user_id ) { + if ( ! $for_user_id ) { $for_user_id = get_current_user_id(); } $user = get_userdata( $for_user_id ); diff --git a/wp-includes/version.php b/wp-includes/version.php index beb08a0cb9..bc0c4a3ac9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-beta1-44602'; +$wp_version = '5.1-beta1-44603'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.