Skip to content

Commit f16b81a

Browse files
committed
Make sure the endpoint is the string before checking the existence of .json substring
1 parent a573900 commit f16b81a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Downloader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function __construct(Composer $composer, IoInterface $io, $rfs)
6565
}
6666
} elseif (\is_array($endpoint) || false !== strpos($endpoint, '.json') || 'flex://defaults' === $endpoint) {
6767
$this->endpoints = array_values((array) $endpoint);
68-
if (false !== strpos($endpoint, '.json')) {
68+
if (\is_string($endpoint) && false !== strpos($endpoint, '.json')) {
6969
$this->endpoints[] = 'flex://defaults';
7070
}
7171
} elseif ($this->isServerlessEnabled() && \is_string($endpoint)) {

0 commit comments

Comments
 (0)