Commit b1814f6a authored by Aaron Parecki's avatar Aaron Parecki

Include port number in parsed "authority" segment. Fixes #47

parent e6a063f5
......@@ -995,6 +995,8 @@ function parseUriToComponents($uri) {
if(array_key_exists('user', $u) || array_key_exists('pass', $u))
$result['authority'] .= '@';
$result['authority'] .= $u['host'];
if(array_key_exists('port', $u))
$result['authority'] .= ':' . $u['port'];
}
if(array_key_exists('path', $u))
......
......@@ -249,7 +249,10 @@ class UrlTest extends PHPUnit_Framework_TestCase {
'http://www.example.com/pathOne/', './jquery.js', 'http://www.example.com/pathOne/jquery.js'),
array('testAbsolutePathHasDotDirecoryAndSourceHasDirectoryWithoutTrailingSlash',
'http://www.example.com/pathOne', './jquery.js', 'http://www.example.com/jquery.js')
'http://www.example.com/pathOne', './jquery.js', 'http://www.example.com/jquery.js'),
array('testAbsolutePathIncludesPortNumber',
'http://example.com:8080/index.html', '/photo.jpg', 'http://example.com:8080/photo.jpg')
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment