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.

Merge of [38429] to the 4.6 branch.

Props dd32, flixos90 for initial patch.
Fixes #37733.

Built from https://develop.svn.wordpress.org/branches/4.6@38485


git-svn-id: http://core.svn.wordpress.org/branches/4.6@38426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Jeremy Felt 2016-08-31 22:01:31 +00:00
parent 0d0310bcd6
commit b6151949af
2 changed files with 4 additions and 1 deletions

View File

@ -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 );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6.1-alpha-38476';
$wp_version = '4.6.1-alpha-38485';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.