Changeset 35280
- Timestamp:
- 10/20/2015 05:27:32 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user-functions.php
r35189 r35280 1276 1276 $userdata = $userdata->to_array(); 1277 1277 } 1278 1278 1279 // Are we updating or creating? 1279 1280 if ( ! empty( $userdata['ID'] ) ) { 1280 1281 $ID = (int) $userdata['ID']; 1281 1282 $update = true; 1282 $old_user_data = WP_User::get_data_by( 'id', $ID ); 1283 $old_user_data = get_userdata( $ID ); 1284 1285 if ( ! $old_user_data ) { 1286 return new WP_Error( 'invalid_user_id', __( 'Invalid user ID.' ) ); 1287 } 1288 1283 1289 // hashed in wp_update_user(), plaintext if called directly 1284 1290 $user_pass = $userdata['user_pass']; -
trunk/tests/phpunit/tests/user.php
r35247 r35280 818 818 $expected = str_repeat( 'a', 48 ) . '-5'; 819 819 $this->assertSame( $expected, $user->user_nicename ); 820 } 821 822 /** 823 * @ticket 28004 824 */ 825 public function test_wp_insert_user_with_invalid_user_id() { 826 $u = wp_insert_user( array( 827 'ID' => 123, 828 'user_login' => 'whatever', 829 'user_email' => 'whatever@example.com', 830 'user_pass' => 'password', 831 ) ); 832 833 $this->assertWPError( $u ); 820 834 } 821 835
Note: See TracChangeset
for help on using the changeset viewer.