WordPress.org

Make WordPress Core

Changeset 19208


Ignore:
Timestamp:
11/07/2011 11:05:13 PM (10 years ago)
Author:
duck_
Message:

get_blogs_of_user() should return false for logged out and non-existent users on single site. See #19160.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/user.php

    r19027 r19208  
    653653    global $wpdb;
    654654
     655    $user_id = (int) $user_id;
     656
     657    // Logged out users can't have blogs
     658    if ( empty( $user_id ) )
     659        return false;
     660
     661    $keys = get_user_meta( $user_id );
     662    if ( empty( $keys ) )
     663        return false;
     664
    655665    if ( ! is_multisite() ) {
    656666        $blog_id = get_current_blog_id();
     
    664674        return $blogs;
    665675    }
    666 
    667     $user_id = (int) $user_id;
    668 
    669     // Logged out users can't have blogs
    670     if ( empty( $user_id ) )
    671         return false;
    672 
    673     $keys = get_user_meta( $user_id );
    674     if ( empty( $keys ) )
    675         return false;
    676676
    677677    $blogs = array();
Note: See TracChangeset for help on using the changeset viewer.