diff --git a/Tests/UriResolverTest.php b/Tests/UriResolverTest.php index b0c227a..f5ca403 100644 --- a/Tests/UriResolverTest.php +++ b/Tests/UriResolverTest.php @@ -84,6 +84,10 @@ public static function provideResolverTests() ['foo', 'http://localhost?bar=1', 'http://localhost/foo'], ['foo', 'http://localhost#bar', 'http://localhost/foo'], + + ['foo:1', 'http://localhost', 'http://localhost/foo:1'], + ['/bar:1', 'http://localhost', 'http://localhost/bar:1'], + ['foo/bar:1', 'http://localhost', 'http://localhost/foo/bar:1'], ]; } } diff --git a/UriResolver.php b/UriResolver.php index d3b0c83..c81dc7b 100644 --- a/UriResolver.php +++ b/UriResolver.php @@ -33,7 +33,7 @@ public static function resolve(string $uri, ?string $baseUri): string $uri = trim($uri); // absolute URL? - if (null !== parse_url($uri, \PHP_URL_SCHEME)) { + if (\is_string(parse_url($uri, \PHP_URL_SCHEME))) { return $uri; }