From ed2d8ddb1eff2d0beef11b31a46bdb3022a2d1a8 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Sat, 10 Nov 2018 22:47:10 -0500 Subject: [PATCH] refactor: fix impossible parse_url equality (#676) `parse_url` returns `false` for malformed urls, not `null` --- src/utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.php b/src/utils.php index 97e091d8..af47a96e 100644 --- a/src/utils.php +++ b/src/utils.php @@ -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']);