Ticket #13903: user-object-logic-check-failures.13903.diff
File user-object-logic-check-failures.13903.diff, 1.7 KB (added by , 14 years ago) |
---|
-
wp-includes/capabilities.php
1112 1112 1113 1113 $author = new WP_User( $post->post_author ); 1114 1114 1115 if ( empty( $author ) )1115 if ( empty( $author->ID ) ) 1116 1116 return false; 1117 1117 1118 1118 $args = array_slice( func_get_args(), 2 ); -
wp-includes/ms-functions.php
209 209 210 210 $user = new WP_User($user_id); 211 211 212 if ( empty( $user) || !$user->ID)212 if ( empty( $user->ID ) ) 213 213 return new WP_Error('user_does_not_exist', __('That user does not exist.')); 214 214 215 215 if ( !get_user_meta($user_id, 'primary_blog', true) ) { … … 253 253 254 254 // wp_revoke_user($user_id); 255 255 $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 256 259 $user->remove_all_caps(); 257 260 258 261 $blogs = get_blogs_of_user($user_id); … … 1326 1329 } 1327 1330 $u = new WP_User( $user_id ); 1328 1331 1329 if ( $u->spam == 1 ) 1330 return true; 1331 1332 return false; 1332 return ( isset( $u->spam ) && $u->spam == 1 ); 1333 1333 } 1334 1334 1335 1335 function update_blog_public( $old_value, $value ) { -
wp-admin/ms-edit.php
264 264 reset( $newroles ); 265 265 foreach ( (array) $newroles as $userid => $role ) { 266 266 $user = new WP_User( $userid ); 267 if ( ! $user)267 if ( empty( $user->ID ) ) 268 268 continue; 269 269 $user->for_blog( $id ); 270 270 $user->set_role( $role );