mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@37163 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -4,6 +4,7 @@ class Spy_REST_Server extends WP_REST_Server {
|
||||
|
||||
public $sent_headers = array();
|
||||
public $sent_body = '';
|
||||
public $last_request = null;
|
||||
|
||||
/**
|
||||
* Get the raw $endpoints data from the server
|
||||
@@ -29,6 +30,17 @@ class Spy_REST_Server extends WP_REST_Server {
|
||||
$this->sent_headers[ $header ] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override the dispatch method so we can get a handle on the request object.
|
||||
*
|
||||
* @param WP_REST_Request $request
|
||||
* @return WP_REST_Response Response returned by the callback.
|
||||
*/
|
||||
public function dispatch( $request ) {
|
||||
$this->last_request = $request;
|
||||
return parent::dispatch( $request );
|
||||
}
|
||||
|
||||
public function serve_request( $path = null ) {
|
||||
|
||||
ob_start();
|
||||
|
||||
Reference in New Issue
Block a user