From b96300e80022a3898bd2735347154d9673455024 Mon Sep 17 00:00:00 2001 From: vdauchy <26772554+vdauchy@users.noreply.github.com> Date: Sun, 12 Nov 2023 18:26:41 +0100 Subject: [PATCH] UriResolver support path with columns --- src/Symfony/Component/DomCrawler/Tests/UriResolverTest.php | 4 ++++ src/Symfony/Component/DomCrawler/UriResolver.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/DomCrawler/Tests/UriResolverTest.php b/src/Symfony/Component/DomCrawler/Tests/UriResolverTest.php index b0c227abf5478..f5ca403a61a4a 100644 --- a/src/Symfony/Component/DomCrawler/Tests/UriResolverTest.php +++ b/src/Symfony/Component/DomCrawler/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/src/Symfony/Component/DomCrawler/UriResolver.php b/src/Symfony/Component/DomCrawler/UriResolver.php index d3b0c839617ea..c96af29208075 100644 --- a/src/Symfony/Component/DomCrawler/UriResolver.php +++ b/src/Symfony/Component/DomCrawler/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; }