Make WordPress Core


Ignore:
Timestamp:
04/29/2020 04:04:20 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.
Block Editor: Coding standards, properly escape class names.
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.4 branch.

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

Location:
branches/5.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.3

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

    r45874 r47644  
    10261026    }
    10271027
    1028     function test_changing_email_invalidates_password_reset_key() {
     1028    public function test_changing_email_invalidates_password_reset_key() {
    10291029        global $wpdb;
    10301030
     
    10511051            'user_nicename' => 'cat',
    10521052            'user_email'    => 'foo@bar.dev',
     1053        );
     1054        wp_update_user( $userdata );
     1055
     1056        $user = get_userdata( $user->ID );
     1057        $this->assertEmpty( $user->user_activation_key );
     1058    }
     1059
     1060    public function test_changing_password_invalidates_password_reset_key() {
     1061        global $wpdb;
     1062
     1063        $user = $this->author;
     1064        $wpdb->update( $wpdb->users, array( 'user_activation_key' => 'key' ), array( 'ID' => $user->ID ) );
     1065        clean_user_cache( $user );
     1066
     1067        $user = get_userdata( $user->ID );
     1068        $this->assertEquals( 'key', $user->user_activation_key );
     1069
     1070        $userdata = array(
     1071            'ID'        => $user->ID,
     1072            'user_pass' => 'password',
    10531073        );
    10541074        wp_update_user( $userdata );
Note: See TracChangeset for help on using the changeset viewer.