Changeset 35618
- Timestamp:
- 11/11/2015 10:30:27 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user-functions.php
r35280 r35618 1288 1288 1289 1289 // hashed in wp_update_user(), plaintext if called directly 1290 $user_pass = $userdata['user_pass'];1290 $user_pass = ! empty( $userdata['user_pass'] ) ? $userdata['user_pass'] : $old_user_data->user_pass; 1291 1291 } else { 1292 1292 $update = false; … … 1331 1331 if ( in_array( $user_login, apply_filters( 'illegal_user_logins', array() ) ) ) { 1332 1332 return new WP_Error( 'illegal_user_login', __( 'Sorry, that username is not allowed.' ) ); 1333 } 1333 } 1334 1334 1335 1335 /* -
trunk/tests/phpunit/tests/user.php
r35280 r35618 1014 1014 $this->assertEquals( $pwd_before, $pwd_after ); 1015 1015 } 1016 1017 /** 1018 * @ticket 29880 1019 */ 1020 function test_wp_insert_user() { 1021 $user_details = array( 1022 'user_login' => rand_str(), 1023 'user_pass' => 'password', 1024 'user_email' => rand_str() . '@example.com', 1025 ); 1026 $id1 = wp_insert_user( $user_details ); 1027 $this->assertEquals( $id1, email_exists( $user_details['user_email'] ) ); 1028 1029 // Check that providing an empty password doesn't remove a user's password. 1030 // See ticket #29880 1031 $user_details['ID'] = $id1; 1032 $user_details['user_pass'] = ''; 1033 $id1 = wp_insert_user( $user_details ); 1034 $user = WP_User::get_data_by( 'id', $id1 ); 1035 $this->assertNotEmpty( $user->user_pass ); 1036 } 1037 1016 1038 }
Note: See TracChangeset
for help on using the changeset viewer.