From 31152de134d9a65b14af7080c8116a59b0dbbc13 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Wed, 6 Apr 2016 21:02:28 +0000 Subject: [PATCH] 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 --- wp-includes/rest-api/class-wp-rest-server.php | 6 +++--- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/rest-api/class-wp-rest-server.php b/wp-includes/rest-api/class-wp-rest-server.php index 25556962b4..ebf58de2bb 100644 --- a/wp-includes/rest-api/class-wp-rest-server.php +++ b/wp-includes/rest-api/class-wp-rest-server.php @@ -303,10 +303,10 @@ class WP_REST_Server { $request = new WP_REST_Request( $_SERVER['REQUEST_METHOD'], $path ); - $request->set_query_params( $_GET ); - $request->set_body_params( $_POST ); + $request->set_query_params( wp_unslash( $_GET ) ); + $request->set_body_params( wp_unslash( $_POST ) ); $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() ); /* diff --git a/wp-includes/version.php b/wp-includes/version.php index ee52a87f0e..93f8170977 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @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.