- Timestamp:
- 08/20/2019 05:25:02 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user.php
r45825 r45858 1795 1795 $data = apply_filters( 'wp_pre_insert_user_data', $data, $update, $update ? (int) $ID : null ); 1796 1796 1797 if ( empty( $data ) || ! is_array( $data ) ) { 1798 return new WP_Error( 'empty_data', __( 'Not enough data to create this user.' ) ); 1799 } 1800 1797 1801 if ( $update ) { 1798 1802 if ( $user_email !== $old_user_data->user_email ) { -
trunk/tests/phpunit/tests/user.php
r45607 r45858 962 962 963 963 $this->assertWPError( $u ); 964 $this->assertSame( 'invalid_user_id', $u->get_error_code() ); 965 } 966 967 /** 968 * @ticket 47902 969 */ 970 public function test_wp_insert_user_with_empty_data() { 971 global $wpdb; 972 973 add_filter( 'wp_pre_insert_user_data', '__return_empty_array' ); 974 975 $u = self::factory()->user->create(); 976 977 remove_filter( 'wp_pre_insert_user_data', '__return_empty_array' ); 978 979 $this->assertWPError( $u ); 980 $this->assertSame( 'empty_data', $u->get_error_code() ); 964 981 } 965 982
Note: See TracChangeset
for help on using the changeset viewer.