Make WordPress Core

Changeset 31269


Ignore:
Timestamp:
01/22/2015 02:45:14 PM (10 years ago)
Author:
SergeyBiryukov
Message:

In wp_update_user(), make sure $userdataID? is set before using it.

props tyxla.
fixes #31097.

File:
1 edited

Legend:

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

    r31188 r31269  
    19761976    }
    19771977
    1978     $ID = (int) $userdata['ID'];
     1978    $ID = isset( $userdata['ID'] ) ? (int) $userdata['ID'] : 0;
     1979    if ( ! $ID ) {
     1980        return new WP_Error( 'invalid_user_id', __( 'Invalid user ID.' ) );
     1981    }
    19791982
    19801983    // First, get all of the original fields
    19811984    $user_obj = get_userdata( $ID );
    1982     if ( ! $user_obj )
     1985    if ( ! $user_obj ) {
    19831986        return new WP_Error( 'invalid_user_id', __( 'Invalid user ID.' ) );
     1987    }
    19841988
    19851989    $user = $user_obj->to_array();
Note: See TracChangeset for help on using the changeset viewer.