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

Props juliobox, SergeyBiryukov.
Fixes #47902.
Built from https://develop.svn.wordpress.org/trunk@45858


git-svn-id: http://core.svn.wordpress.org/trunk@45669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-08-20 17:26:55 +00:00
parent bdb1811935
commit 022de7321e
2 changed files with 5 additions and 1 deletions

View File

@ -1794,6 +1794,10 @@ function wp_insert_user( $userdata ) {
*/
$data = apply_filters( 'wp_pre_insert_user_data', $data, $update, $update ? (int) $ID : null );
if ( empty( $data ) || ! is_array( $data ) ) {
return new WP_Error( 'empty_data', __( 'Not enough data to create this user.' ) );
}
if ( $update ) {
if ( $user_email !== $old_user_data->user_email ) {
$data['user_activation_key'] = '';

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-45857';
$wp_version = '5.3-alpha-45858';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.