From e45ebb28f2e7fb2fbb14dfd279a33f266b8dcf85 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 29 Aug 2016 02:33:34 +0000 Subject: [PATCH] HTTP: Handle an edgecase within the URI parsing library included in Requests, where if a double slash exists at the start of the path the URL is passed to cURL malformed. Props flixos90 for initial patch. Fixes #37733 for trunk. Built from https://develop.svn.wordpress.org/trunk@38429 git-svn-id: http://core.svn.wordpress.org/trunk@38370 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-http.php | 3 +++ wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php index 9d5fca0eab..2fd4c54ea6 100644 --- a/wp-includes/class-http.php +++ b/wp-includes/class-http.php @@ -362,6 +362,9 @@ class WP_Http { } } + // Work around a bug in Requests when the path starts with // See https://github.com/rmccue/Requests/issues/231 + $url = preg_replace( '!^(\w+://[^/]+)//(.*)$!i', '$1/$2', $url ); + try { $requests_response = Requests::request( $url, $headers, $data, $type, $options ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 8e5c8b6676..f13c61365f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38428'; +$wp_version = '4.7-alpha-38429'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.