Skip to content

Commit

Permalink
Fixed wrong parameter order in explode() (#2866)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm committed Mar 7, 2021
1 parent 2793fe2 commit da94ef2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Utils.php
Expand Up @@ -232,7 +232,7 @@ public static function isHostInNoProxy(string $host, array $noProxyArray): bool
// Strip port if present.
if (\strpos($host, ':')) {
/** @var string[] $hostParts will never be false because of the checks above */
$hostParts = \explode($host, ':', 2);
$hostParts = \explode(':', $host, 2);
$host = $hostParts[0];
}

Expand Down
1 change: 1 addition & 0 deletions tests/UtilsTest.php
Expand Up @@ -117,6 +117,7 @@ public function noProxyProvider()
return [
['mit.edu', ['.mit.edu'], false],
['foo.mit.edu', ['.mit.edu'], true],
['foo.mit.edu:123', ['.mit.edu'], true],
['mit.edu', ['mit.edu'], true],
['mit.edu', ['baz', 'mit.edu'], true],
['mit.edu', ['', '', 'mit.edu'], true],
Expand Down

0 comments on commit da94ef2

Please sign in to comment.