Make WordPress Core


Ignore:
Timestamp:
04/29/2020 04:13:02 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], [47636], [47637], and [47638] to the 5.0 branch.

Props: aduth, batmoo, ehti, ellatrix, jorgefilipecosta, nickdaugherty, noisysocks, pento, peterwilsoncc, sergeybiryukov, sstoqnov, talldanwp, westi, westonruter, whyisjake, whyisjake, xknown.

Location:
branches/5.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0

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

    r43459 r47647  
    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.