mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-02 09:30:09 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@38429 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user