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.
Built from https://develop.svn.wordpress.org/trunk@37163


git-svn-id: http://core.svn.wordpress.org/trunk@37130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Mark Jaquith 2016-04-06 21:02:28 +00:00
parent b3b22fa1c6
commit 31152de134
2 changed files with 4 additions and 4 deletions

View File

@ -303,10 +303,10 @@ class WP_REST_Server {
$request = new WP_REST_Request( $_SERVER['REQUEST_METHOD'], $path ); $request = new WP_REST_Request( $_SERVER['REQUEST_METHOD'], $path );
$request->set_query_params( $_GET ); $request->set_query_params( wp_unslash( $_GET ) );
$request->set_body_params( $_POST ); $request->set_body_params( wp_unslash( $_POST ) );
$request->set_file_params( $_FILES ); $request->set_file_params( $_FILES );
$request->set_headers( $this->get_headers( $_SERVER ) ); $request->set_headers( $this->get_headers( wp_unslash( $_SERVER ) ) );
$request->set_body( $this->get_raw_data() ); $request->set_body( $this->get_raw_data() );
/* /*

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.5-RC1-37162'; $wp_version = '4.5-RC1-37163';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.