WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/29/2020 04:15:39 PM (21 months ago)
Author:
whyisjake
Message:

Customize: Add additional filters to Customizer to prevent JSON corruption.
User: Invalidate user_activation_key on password update.
Query: Ensure that only a single post can be returned on date/time based queries.
Cache API: Ensure proper escaping around the stats method in the cache API.
Formatting: Expand sanitize_file_name to have better support for utf8 characters.

Brings the changes in [47633], [47634], [47635], [47637], and [47638] to the 4.9 branch.

Props: batmoo, ehti, nickdaugherty, peterwilsoncc, sergeybiryukov, sstoqnov, westi, westonruter, whyisjake, whyisjake, xknown.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/tests/phpunit/tests/user.php

    r43459 r47648  
    918918    }
    919919
    920     function test_changing_email_invalidates_password_reset_key() {
     920    public function test_changing_email_invalidates_password_reset_key() {
    921921        global $wpdb;
    922922
     
    943943            'user_nicename' => 'cat',
    944944            'user_email'    => 'foo@bar.dev',
     945        );
     946        wp_update_user( $userdata );
     947
     948        $user = get_userdata( $user->ID );
     949        $this->assertEmpty( $user->user_activation_key );
     950    }
     951
     952    public function test_changing_password_invalidates_password_reset_key() {
     953        global $wpdb;
     954
     955        $user = $this->author;
     956        $wpdb->update( $wpdb->users, array( 'user_activation_key' => 'key' ), array( 'ID' => $user->ID ) );
     957        clean_user_cache( $user );
     958
     959        $user = get_userdata( $user->ID );
     960        $this->assertEquals( 'key', $user->user_activation_key );
     961
     962        $userdata = array(
     963            'ID'        => $user->ID,
     964            'user_pass' => 'password',
    945965        );
    946966        wp_update_user( $userdata );
Note: See TracChangeset for help on using the changeset viewer.