Ticket #38070: 38070.patch
File 38070.patch, 1.2 KB (added by , 8 years ago) |
---|
-
src/wp-includes/class-http.php
359 359 } 360 360 361 361 // Work around a bug in Requests when the path starts with // See https://github.com/rmccue/Requests/issues/231 362 $url = preg_replace( '!^(\w+://[^/ ]+)//(.*)$!i', '$1/$2', $url );362 $url = preg_replace( '!^(\w+://[^/?]+)//(.*)$!i', '$1/$2', $url ); 363 363 364 364 try { 365 365 $requests_response = Requests::request( $url, $headers, $data, $type, $options ); -
tests/phpunit/tests/http/base.php
389 389 $this->assertNotWPError( $res ); 390 390 } 391 391 392 /** 393 * @ticket 37733 394 */ 395 function test_url_with_double_slashes_query() { 396 $url = 'https://wordpress.org?url=http://example.org'; 392 397 398 $res = wp_remote_request( $url ); 399 $this->assertNotWPError( $res ); 400 401 $response = $res['http_response']->get_response_object(); 402 $this->assertContains( '?url=http://example.org', $response->url ); 403 } 404 393 405 }