Making WordPress.org


Ignore:
Timestamp:
10/06/2022 02:57:52 AM (2 years ago)
Author:
dd32
Message:

User Tweaks: Cast the user ID to a string, as some PHP functions balk at ints being passed where a string was expected.

See r12104, #4644.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-user-tweaks.php

    r12104 r12105  
    1515
    1616    if ( '' === $name && $user_id ) {
    17         $name = get_user_by( 'id', $user_id )->user_nicename ?? $user_id;
     17        $name = get_user_by( 'id', $user_id )->user_nicename ?? (string) $user_id;
    1818    }
    1919
     
    2727
    2828    if ( '' === $name && $user_id ) {
    29         $name = get_user_by( 'id', $user_id )->user_nicename ?? $user_id;
     29        $name = get_user_by( 'id', $user_id )->user_nicename ?? (string) $user_id;
    3030    }
    3131
Note: See TracChangeset for help on using the changeset viewer.