Skip to content

Commit

Permalink
[DomCrawler] UriResolver support path with columns
Browse files Browse the repository at this point in the history
  • Loading branch information
vdauchy authored and nicolas-grekas committed Nov 14, 2023
1 parent d2aefa5 commit a92d93a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Tests/UriResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
];
}
}
2 changes: 1 addition & 1 deletion UriResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a92d93a

Please sign in to comment.