Make WordPress Core


Ignore:
Timestamp:
04/29/2020 04:18:07 PM (6 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.8 branch.

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

Location:
branches/4.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.8

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

    r40564 r47649  
    916916    }
    917917
    918     function test_changing_email_invalidates_password_reset_key() {
     918    public function test_changing_email_invalidates_password_reset_key() {
    919919        global $wpdb;
    920920
     
    941941            'user_nicename' => 'cat',
    942942            'user_email'    => 'foo@bar.dev',
     943        );
     944        wp_update_user( $userdata );
     945
     946        $user = get_userdata( $user->ID );
     947        $this->assertEmpty( $user->user_activation_key );
     948    }
     949
     950    public function test_changing_password_invalidates_password_reset_key() {
     951        global $wpdb;
     952
     953        $user = $this->author;
     954        $wpdb->update( $wpdb->users, array( 'user_activation_key' => 'key' ), array( 'ID' => $user->ID ) );
     955        clean_user_cache( $user );
     956
     957        $user = get_userdata( $user->ID );
     958        $this->assertEquals( 'key', $user->user_activation_key );
     959
     960        $userdata = array(
     961            'ID'        => $user->ID,
     962            'user_pass' => 'password',
    943963        );
    944964        wp_update_user( $userdata );
Note: See TracChangeset for help on using the changeset viewer.