WordPress.org

Make WordPress Core

Changeset 17379


Ignore:
Timestamp:
02/03/11 00:17:30 (3 years ago)
Author:
markjaquith
Message:

restore_current_blog() in add_user_to_blog() and remove_user_from_blog() before early return, to avoid being stuck in a switched state. props mdawaffe. fixes #16444 for trunk.

File:
1 edited

Legend:

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

    r17228 r17379  
    210210    $user = new WP_User($user_id); 
    211211 
    212     if ( empty( $user->ID ) ) 
     212    if ( empty( $user->ID ) ) { 
     213        restore_current_blog(); 
    213214        return new WP_Error('user_does_not_exist', __('That user does not exist.')); 
     215    } 
    214216 
    215217    if ( !get_user_meta($user_id, 'primary_blog', true) ) { 
     
    270272    // wp_revoke_user($user_id); 
    271273    $user = new WP_User($user_id); 
    272     if ( empty( $user->ID ) ) 
     274    if ( empty( $user->ID ) ) { 
     275        restore_current_blog(); 
    273276        return new WP_Error('user_does_not_exist', __('That user does not exist.')); 
     277    } 
    274278 
    275279    $user->remove_all_caps(); 
Note: See TracChangeset for help on using the changeset viewer.