Make WordPress Core


Ignore:
Timestamp:
08/04/2016 07:13:41 AM (8 years ago)
Author:
dd32
Message:

Requests: Merge handling for custom HTTP methods.

This merges the latest changes to Requests from upstream to add support for custom HTTP methods.
See https://github.com/rmccue/Requests/commit/1b5ffd8501503e0641b7fa0c555ccf99973135e2

Props Ipstenu, ocean90.
Fixes #37503 for trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/Requests/Transport/cURL.php

    r38049 r38191  
    334334                curl_setopt($this->handle, CURLOPT_POSTFIELDS, $data);
    335335                break;
    336             case Requests::PATCH:
    337             case Requests::PUT:
    338             case Requests::DELETE:
    339             case Requests::OPTIONS:
    340                 curl_setopt($this->handle, CURLOPT_CUSTOMREQUEST, $options['type']);
    341                 curl_setopt($this->handle, CURLOPT_POSTFIELDS, $data);
    342                 break;
    343336            case Requests::HEAD:
    344337                curl_setopt($this->handle, CURLOPT_CUSTOMREQUEST, $options['type']);
     
    348341                curl_setopt($this->handle, CURLOPT_CUSTOMREQUEST, $options['type']);
    349342                break;
     343            case Requests::PATCH:
     344            case Requests::PUT:
     345            case Requests::DELETE:
     346            case Requests::OPTIONS:
     347            default:
     348                curl_setopt($this->handle, CURLOPT_CUSTOMREQUEST, $options['type']);
     349                if (!empty($data)) {
     350                    curl_setopt( $this->handle, CURLOPT_POSTFIELDS, $data );
     351                }
    350352        }
    351353
Note: See TracChangeset for help on using the changeset viewer.