Make WordPress Core


Ignore:
Timestamp:
04/06/2016 09:01:11 PM (11 years ago)
Author:
markjaquith
Message:

REST API: Deliver parameters unadulterated instead of slashed.

We goofed, and parameters accessed through the REST API's methods
were slashed (inconsistently, even). This unslashes the data, so
you get the un-messed-with data that was sent.

Props joehoyle.
Fixes #36419.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/spy-rest-server.php

    r35773 r37163  
    55        public $sent_headers = array();
    66        public $sent_body = '';
     7        public $last_request = null;
    78
    89        /**
    … …  
    3031        }
    3132
     33        /**
     34         * Override the dispatch method so we can get a handle on the request object.
     35         *
     36         * @param  WP_REST_Request $request
     37         * @return WP_REST_Response Response returned by the callback.
     38         */
     39        public function dispatch( $request ) {
     40                $this->last_request = $request;
     41                return parent::dispatch( $request );
     42        }
     43
    3244        public function serve_request( $path = null ) {
    3345
Note: See TracChangeset for help on using the changeset viewer.