From 67de1f07d31980182c76b81414c2439b6b60c649 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Wed, 13 Jul 2016 15:51:28 +0000 Subject: [PATCH] HTTP API: Pass proxy settings to Requests. `WP_HTTP_Proxy()` is used directly in `WP_Http_Curl()` and `WP_Http_Streams()`. Since `WP_Http::request()` doesn't use them anymore we have to move the proxy handling into `WP_Http::request()` so the proxy data can be passed to `Requests::request()`. Props rmccue. See #33055. Fixes #37107. Built from https://develop.svn.wordpress.org/trunk@38054 git-svn-id: http://core.svn.wordpress.org/trunk@37995 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-http.php | 11 +++++++++++ wp-includes/version.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php index 692b499778..8360abcb03 100644 --- a/wp-includes/class-http.php +++ b/wp-includes/class-http.php @@ -347,6 +347,17 @@ class WP_Http { */ $options['verify'] = apply_filters( 'https_ssl_verify', $options['verify'] ); + // Check for proxies. + $proxy = new WP_HTTP_Proxy(); + if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { + $options['proxy'] = new Requests_Proxy_HTTP( $proxy->host() . ':' . $proxy->port() ); + + if ( $proxy->use_authentication() ) { + $options['proxy']->user = $proxy->username(); + $options['proxy']->pass = $proxy->password(); + } + } + try { $requests_response = Requests::request( $url, $headers, $data, $type, $options ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 3ffda2fb2c..8f9637005c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-beta2-38053'; +$wp_version = '4.6-beta2-38054'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.