Skip to content

Commit

Permalink
refactor: fix impossible parse_url equality (#676)
Browse files Browse the repository at this point in the history
`parse_url` returns `false` for malformed urls, not `null`
  • Loading branch information
muglug authored and felixfbecker committed Nov 11, 2018
1 parent 680f430 commit ed2d8dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function pathToUri(string $filepath): string
function uriToPath(string $uri)
{
$fragments = parse_url($uri);
if ($fragments === null || !isset($fragments['scheme']) || $fragments['scheme'] !== 'file') {
if ($fragments === false || !isset($fragments['scheme']) || $fragments['scheme'] !== 'file') {
throw new InvalidArgumentException("Not a valid file URI: $uri");
}
$filepath = urldecode($fragments['path']);
Expand Down

0 comments on commit ed2d8dd

Please sign in to comment.