Make WordPress Core


Ignore:
Timestamp:
10/14/2019 07:29:52 PM (6 years ago)
Author:
whyisjake
Message:

Backporting several bug fixes.

  • Query: Remove the static query property.
  • HTTP API: Protect against hex interpretation.
  • Filesystem API: Prevent directory travelersals when creating new folders.
  • Administration: Ensure that admin referer nonce is valid.
  • REST API: Send a Vary: Origin header on GET requests.
  • Customizer: Properly sanitize background images.

Backports [46474], [46475], [46476], [46477], [46478], [46483], [46485] to the 3.8 branch.

Location:
branches/3.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.8

  • branches/3.8/tests/phpunit/tests/auth.php

    r30469 r46504  
    9494    }
    9595
     96    /**
     97     * @ticket 29217
     98     */
     99    function test_wp_verify_nonce_with_empty_arg() {
     100        $this->assertFalse( wp_verify_nonce( '' ) );
     101        $this->assertFalse( wp_verify_nonce( null ) );
     102    }
     103
     104    /**
     105     * @ticket 29542
     106     */
     107    function test_wp_verify_nonce_with_integer_arg() {
     108        $this->assertFalse( wp_verify_nonce( 1 ) );
     109    }
     110
     111    /**
     112     * @ticket 36361
     113     */
     114    public function test_check_admin_referer_with_no_action_triggers_doing_it_wrong() {
     115        $this->setExpectedIncorrectUsage( 'check_admin_referer' );
     116
     117        // A valid nonce needs to be set so the check doesn't die()
     118        $_REQUEST['_wpnonce'] = wp_create_nonce( -1 );
     119        $result = check_admin_referer();
     120        $this->assertSame( 1, $result );
     121
     122        unset( $_REQUEST['_wpnonce'] );
     123    }
     124
     125    /**
     126     * @ticket 36361
     127     */
     128    public function test_check_ajax_referer_with_no_action_triggers_doing_it_wrong() {
     129        $this->setExpectedIncorrectUsage( 'check_ajax_referer' );
     130
     131        // A valid nonce needs to be set so the check doesn't die()
     132        $_REQUEST['_wpnonce'] = wp_create_nonce( -1 );
     133        $result = check_ajax_referer();
     134        $this->assertSame( 1, $result );
     135
     136        unset( $_REQUEST['_wpnonce'] );
     137    }
     138
    96139    function test_password_length_limit() {
    97140        $passwords = array(
Note: See TracChangeset for help on using the changeset viewer.