From 26758ec22fe54cda048228b6765597a6fed1ef39 Mon Sep 17 00:00:00 2001 From: ocean90 Date: Wed, 13 Jul 2016 15:43:02 +0000 Subject: [PATCH] HTTP API: Update Requests. Fixes an issue where you couldn't set a `Requests_Proxy_HTTP` object as a proxy setting. See https://github.com/rmccue/Requests/pull/223. See #37107, #33055. git-svn-id: https://develop.svn.wordpress.org/trunk@38053 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-requests.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/class-requests.php b/src/wp-includes/class-requests.php index f5aced060a..5efdca8d1f 100644 --- a/src/wp-includes/class-requests.php +++ b/src/wp-includes/class-requests.php @@ -323,7 +323,7 @@ class Requests { * for Basic authentication * (Requests_Auth|array|boolean, default: false) * - `proxy`: Proxy details to use for proxy by-passing and authentication - * (Requests_Proxy|array|boolean, default: false) + * (Requests_Proxy|array|string|boolean, default: false) * - `max_bytes`: Limit for the response body size. * (integer|boolean, default: false) * - `idn`: Enable IDN parsing @@ -575,7 +575,7 @@ class Requests { $options['auth']->register($options['hooks']); } - if (!empty($options['proxy'])) { + if (is_string($options['proxy']) || is_array($options['proxy'])) { $options['proxy'] = new Requests_Proxy_HTTP($options['proxy']); } if ($options['proxy'] !== false) {