WordPress.org

Make WordPress Core

Changeset 23211


Ignore:
Timestamp:
12/27/12 15:37:53 (16 months ago)
Author:
nacin
Message:

Return WP_Error from wp_update_user() on a non-existent user, avoiding a fatal error in the process.

Merges [23210] to the 3.5 branch.

props n7studios, SergeyBiryukov.
fixes #22858.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.5/wp-includes/user.php

    r22386 r23211  
    14531453    // First, get all of the original fields 
    14541454    $user_obj = get_userdata( $ID ); 
     1455    if ( ! $user_obj ) 
     1456        return new WP_Error( 'invalid_user_id', __( 'Invalid user ID.' ) ); 
    14551457 
    14561458    $user = $user_obj->to_array(); 
Note: See TracChangeset for help on using the changeset viewer.