Make WordPress Core


Ignore:
Timestamp:
04/29/2020 04:22:22 PM (5 years 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.7 branch.

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

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

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

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