From 83b966c1cf04ac50188204d000677c216a5c9aff Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sun, 6 Jun 2021 10:04:50 +0200 Subject: [PATCH] [Asset] Don't pass null to strpos() Signed-off-by: Alexander M. Turek --- .../Asset/VersionStrategy/JsonManifestVersionStrategy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Asset/VersionStrategy/JsonManifestVersionStrategy.php b/src/Symfony/Component/Asset/VersionStrategy/JsonManifestVersionStrategy.php index e72cdc1f174a6..256bc21963720 100644 --- a/src/Symfony/Component/Asset/VersionStrategy/JsonManifestVersionStrategy.php +++ b/src/Symfony/Component/Asset/VersionStrategy/JsonManifestVersionStrategy.php @@ -39,7 +39,7 @@ public function __construct(string $manifestPath, HttpClientInterface $httpClien $this->manifestPath = $manifestPath; $this->httpClient = $httpClient; - if (null === $this->httpClient && 0 === strpos(parse_url($this->manifestPath, \PHP_URL_SCHEME), 'http')) { + if (null === $this->httpClient && ($scheme = parse_url($this->manifestPath, \PHP_URL_SCHEME)) && 0 === strpos($scheme, 'http')) { throw new \LogicException(sprintf('The "%s" class needs an HTTP client to use a remote manifest. Try running "composer require symfony/http-client".', self::class)); } }