Correctly handle url's containing url's in WP_HTTP::make_absolute_url().

A valid relative URL could be mistaken for an absolute url if it contained a :// in any position of the url.
Fixes #28001


git-svn-id: https://develop.svn.wordpress.org/trunk@29850 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2014-10-08 05:37:56 +00:00
parent 60b8ed120a
commit e4268adfde
2 changed files with 10 additions and 5 deletions

View File

@@ -56,7 +56,11 @@ class Tests_HTTP_HTTP extends WP_UnitTestCase {
array( 'otherfile.ext?query=string', 'http://example.com/file.ext?existing=query-string', 'http://example.com/otherfile.ext?query=string' ),
// A file with a leading dot
array( '.ext', 'http://example.com/', 'http://example.com/.ext' )
array( '.ext', 'http://example.com/', 'http://example.com/.ext' ),
// URls within URLs
array( '/expected', 'http://example.com/sub/http://site.com/sub/', 'http://example.com/expected' ),
array( '/expected/http://site.com/sub/', 'http://example.com/', 'http://example.com/expected/http://site.com/sub/' ),
);
}
}