Make WordPress Core


Ignore:
Timestamp:
07/13/2010 09:27:05 PM (14 years ago)
Author:
nacin
Message:

Fix checking for whether WP_User object is actually a user. props filosofo, fixes #13903 for trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-functions.php

    r15315 r15404  
    210210    $user = new WP_User($user_id);
    211211
    212     if ( empty($user) || !$user->ID )
     212    if ( empty( $user->ID ) )
    213213        return new WP_Error('user_does_not_exist', __('That user does not exist.'));
    214214
     
    254254    // wp_revoke_user($user_id);
    255255    $user = new WP_User($user_id);
     256    if ( empty( $user->ID ) )
     257        return new WP_Error('user_does_not_exist', __('That user does not exist.'));
     258
    256259    $user->remove_all_caps();
    257260
     
    13271330    $u = new WP_User( $user_id );
    13281331
    1329     if ( $u->spam == 1 )
    1330         return true;
    1331 
    1332     return false;
     1332    return ( isset( $u->spam ) && $u->spam == 1 );
    13331333}
    13341334
Note: See TracChangeset for help on using the changeset viewer.