Make WordPress Core

Changeset 38165


Ignore:
Timestamp:
07/27/2016 03:51:19 PM (8 years ago)
Author:
ocean90
Message:

HTTP API: All non-GET/HEAD requests should put the arguments in the form body.

Requests defaults to _GET/query for HEAD/GET/DELETE and _POST/body for POST/PUT/OPTIONS/PATCH. For backward compatibility WP_HTTP needs to force data_format to 'body' for all non-GET/HEAD requests.

Props dd32.
Fixes #37456.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-http.php

    r38164 r38165  
    316316        if ( empty( $r['redirection'] ) ) {
    317317            $options['follow_redirects'] = false;
    318         }
    319         else {
     318        } else {
    320319            $options['redirects'] = $r['redirection'];
    321320        }
     
    334333        if ( ! $r['sslverify'] ) {
    335334            $options['verify'] = false;
    336         }
    337         else {
     335        } else {
    338336            $options['verify'] = $r['sslcertificates'];
     337        }
     338
     339        // All non-GET/HEAD requests should put the arguments in the form body.
     340        if ( 'HEAD' !== $type && 'GET' !== $type ) {
     341            $options['data_format'] = 'body';
    339342        }
    340343
Note: See TracChangeset for help on using the changeset viewer.