From f980f4ca90bb9ca1b04b074729a13883f0a68896 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 24 Feb 2017 20:56:34 +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. Merges [40105] to the 4.7 branch. Fixes #39933. Built from https://develop.svn.wordpress.org/branches/4.7@40113 git-svn-id: http://core.svn.wordpress.org/branches/4.7@40050 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 04416fed19..545d66a001 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7.3-alpha-40112'; +$wp_version = '4.7.3-alpha-40113'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.