diff --git a/src/Symfony/Component/DomCrawler/Tests/UriResolverTest.php b/src/Symfony/Component/DomCrawler/Tests/UriResolverTest.php index f5ca403a61a4..ab98cb52cbee 100644 --- a/src/Symfony/Component/DomCrawler/Tests/UriResolverTest.php +++ b/src/Symfony/Component/DomCrawler/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/src/Symfony/Component/DomCrawler/UriResolver.php b/src/Symfony/Component/DomCrawler/UriResolver.php index 903696ba8fec..5ff2245284c6 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 (\is_string(parse_url($uri, \PHP_URL_SCHEME))) { + if (null !== parse_url($uri, \PHP_URL_SCHEME)) { return $uri; }