mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +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:
@@ -376,5 +376,18 @@ abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase {
|
||||
$this->assertTrue( ! is_wp_error( $res ), print_r( $res, true ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 37733
|
||||
*/
|
||||
function test_url_with_double_slashes_path() {
|
||||
$url = $this->redirection_script . '?rt=' . 0;
|
||||
|
||||
$path = parse_url( $url, PHP_URL_PATH );
|
||||
$url = str_replace( $path, '/' . $path, $url );
|
||||
|
||||
$res = wp_remote_request( $url );
|
||||
$this->assertNotWPError( $res );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user