Make WordPress Core


Ignore:
Timestamp:
08/20/2019 05:25:02 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Users: In wp_insert_user(), account for the wp_pre_insert_user_data filter returning empty data.

Props juliobox, SergeyBiryukov.
Fixes #47902.

File:
1 edited

Legend:

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

    r45825 r45858  
    17951795    $data = apply_filters( 'wp_pre_insert_user_data', $data, $update, $update ? (int) $ID : null );
    17961796
     1797    if ( empty( $data ) || ! is_array( $data ) ) {
     1798        return new WP_Error( 'empty_data', __( 'Not enough data to create this user.' ) );
     1799    }
     1800
    17971801    if ( $update ) {
    17981802        if ( $user_email !== $old_user_data->user_email ) {
Note: See TracChangeset for help on using the changeset viewer.