From 728f1fc136252a626ba5a69c02bd66a3697ff201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Fri, 17 Nov 2023 15:11:02 +0100 Subject: [PATCH] [DomCrawler] Revert "bug #52579 UriResolver support path with colons" --- Tests/UriResolverTest.php | 4 +--- UriResolver.php | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Tests/UriResolverTest.php b/Tests/UriResolverTest.php index f5ca403..ab98cb5 100644 --- a/Tests/UriResolverTest.php +++ b/Tests/UriResolverTest.php @@ -85,9 +85,7 @@ 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'], + ['http://', 'http://localhost', 'http://'], ]; } } diff --git a/UriResolver.php b/UriResolver.php index 903696b..5ff2245 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 (\is_string(parse_url($uri, \PHP_URL_SCHEME))) { + if (null !== parse_url($uri, \PHP_URL_SCHEME)) { return $uri; }