1
0
Fork 0

refactor: fix impossible parse_url equality (#676)

`parse_url` returns `false` for malformed urls, not `null`
pull/667/head v5.4.4
Matthew Brown 2018-11-10 22:47:10 -05:00 committed by Felix Becker
parent 680f430453
commit ed2d8ddb1e
1 changed files with 1 additions and 1 deletions

View File

@ -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']);