Changeset 47640
- Timestamp:
- 04/29/2020 03:46:39 PM (5 years ago)
- Location:
- branches/5.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.4
-
branches/5.4/src/wp-includes/user.php
r47412 r47640 1804 1804 1805 1805 if ( $update ) { 1806 if ( $user_email !== $old_user_data->user_email ) {1806 if ( $user_email !== $old_user_data->user_email || $user_pass !== $old_user_data->user_pass ) { 1807 1807 $data['user_activation_key'] = ''; 1808 1808 } -
branches/5.4/tests/phpunit/tests/user.php
r47279 r47640 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.