From daaf1f2980d30ff0275ee592299726fa94250845 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Thu, 4 Oct 2018 14:21:47 -0400 Subject: [PATCH] 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 97e091d..af47a96 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']);