Make WordPress Core

Ticket #24992: 24992.2.patch

File 24992.2.patch, 1.9 KB (added by SergeyBiryukov, 11 years ago)
  • src/wp-admin/includes/user.php

     
    195195 * @since 2.0.5
    196196 *
    197197 * @param int $user_id User ID.
    198  * @return object WP_User object with user data.
     198 * @return WP_User|bool WP_User object on success, false on failure.
    199199 */
    200200function get_user_to_edit( $user_id ) {
    201201        $user = get_userdata( $user_id );
    202202
    203         $user->filter = 'edit';
     203        if ( $user )
     204                $user->filter = 'edit';
    204205
    205206        return $user;
    206207}
  • src/wp-includes/pluggable.php

     
    115115 * @since 0.71
    116116 *
    117117 * @param int $user_id User ID
    118  * @return bool|object False on failure, WP_User object on success
     118 * @return WP_User|bool WP_User object on success, false on failure.
    119119 */
    120120function get_userdata( $user_id ) {
    121121        return get_user_by( 'id', $user_id );
     
    130130 *
    131131 * @param string $field The field to retrieve the user with. id | slug | email | login
    132132 * @param int|string $value A value for $field. A user ID, slug, email address, or login name.
    133  * @return bool|object False on failure, WP_User object on success
     133 * @return WP_User|bool WP_User object on success, false on failure.
    134134 */
    135135function get_user_by( $field, $value ) {
    136136        $userdata = WP_User::get_data_by( $field, $value );
     
    463463 *
    464464 * @param string $username User's username
    465465 * @param string $password User's password
    466  * @return WP_Error|WP_User WP_User object if login successful, otherwise WP_Error object.
     466 * @return WP_User|WP_Error WP_User object if login successful, otherwise WP_Error object.
    467467 */
    468468function wp_authenticate($username, $password) {
    469469        $username = sanitize_user($username);