From 7d421b20427ce82af113f34564d658245241aab7 Mon Sep 17 00:00:00 2001 From: James Nylen Date: Thu, 23 Feb 2017 20:10:44 +0000 Subject: [PATCH] REST API: Correctly parse body parameters for DELETE requests. DELETE was inadvertently omitted from the list of non-POST HTTP methods that should be able to accept body parameters. Parameters passed to DELETE requests as JSON are already parsed correctly; this commit fixes `application/x-www-form-urlencoded` parameters as well. Props mnelson4. Fixes #39933. Built from https://develop.svn.wordpress.org/trunk@40105 git-svn-id: http://core.svn.wordpress.org/trunk@40042 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rest-api/class-wp-rest-request.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/rest-api/class-wp-rest-request.php b/wp-includes/rest-api/class-wp-rest-request.php index 4dd0dc2090..74a81c92e8 100644 --- a/wp-includes/rest-api/class-wp-rest-request.php +++ b/wp-includes/rest-api/class-wp-rest-request.php @@ -364,7 +364,7 @@ class WP_REST_Request implements ArrayAccess { $this->parse_body_params(); } - $accepts_body_data = array( 'POST', 'PUT', 'PATCH' ); + $accepts_body_data = array( 'POST', 'PUT', 'PATCH', 'DELETE' ); if ( in_array( $this->method, $accepts_body_data ) ) { $order[] = 'POST'; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 52510b5a3d..58d3ee09dc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-40104'; +$wp_version = '4.8-alpha-40105'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.