Changeset 47634
- Timestamp:
- 04/29/2020 03:23:37 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user.php
r47611 r47634 1813 1813 1814 1814 if ( $update ) { 1815 if ( $user_email !== $old_user_data->user_email ) {1815 if ( $user_email !== $old_user_data->user_email || $user_pass !== $old_user_data->user_pass ) { 1816 1816 $data['user_activation_key'] = ''; 1817 1817 } -
trunk/tests/phpunit/tests/user.php
r47279 r47634 1037 1037 } 1038 1038 1039 function test_changing_email_invalidates_password_reset_key() {1039 public function test_changing_email_invalidates_password_reset_key() { 1040 1040 global $wpdb; 1041 1041 … … 1062 1062 'user_nicename' => 'cat', 1063 1063 'user_email' => 'foo@bar.dev', 1064 ); 1065 wp_update_user( $userdata ); 1066 1067 $user = get_userdata( $user->ID ); 1068 $this->assertEmpty( $user->user_activation_key ); 1069 } 1070 1071 public function test_changing_password_invalidates_password_reset_key() { 1072 global $wpdb; 1073 1074 $user = $this->author; 1075 $wpdb->update( $wpdb->users, array( 'user_activation_key' => 'key' ), array( 'ID' => $user->ID ) ); 1076 clean_user_cache( $user ); 1077 1078 $user = get_userdata( $user->ID ); 1079 $this->assertEquals( 'key', $user->user_activation_key ); 1080 1081 $userdata = array( 1082 'ID' => $user->ID, 1083 'user_pass' => 'password', 1064 1084 ); 1065 1085 wp_update_user( $userdata );
Note: See TracChangeset
for help on using the changeset viewer.