diff --git a/FileLocator.php b/FileLocator.php index e221af09b..3a5064edc 100644 --- a/FileLocator.php +++ b/FileLocator.php @@ -87,6 +87,7 @@ private function isAbsolutePath(string $file): bool && ('\\' === $file[2] || '/' === $file[2]) ) || parse_url($file, \PHP_URL_SCHEME) + || str_starts_with($file, 'phar:///') // "parse_url()" doesn't handle absolute phar path, despite being valid ) { return true; } diff --git a/Tests/FileLocatorTest.php b/Tests/FileLocatorTest.php index d042bff7d..beb005a35 100644 --- a/Tests/FileLocatorTest.php +++ b/Tests/FileLocatorTest.php @@ -38,6 +38,7 @@ public static function getIsAbsolutePathTests(): array ['\\server\\foo.xml'], ['https://server/foo.xml'], ['phar://server/foo.xml'], + ['phar:///server/foo.xml'], ]; }