WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/23/2017 08:09:11 PM (3 years ago)
Author:
jnylen0
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/class-wp-rest-request.php

    r39594 r40105  
    365365        }
    366366
    367         $accepts_body_data = array( 'POST', 'PUT', 'PATCH' );
     367        $accepts_body_data = array( 'POST', 'PUT', 'PATCH', 'DELETE' );
    368368        if ( in_array( $this->method, $accepts_body_data ) ) {
    369369            $order[] = 'POST';
Note: See TracChangeset for help on using the changeset viewer.