Skip to content

Commit

Permalink
[Config] Handle Phar absolute path in FileLocator
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-daubois committed Oct 30, 2024
1 parent b9d94b0 commit 977c88a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions FileLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,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;
}
Expand Down
1 change: 1 addition & 0 deletions Tests/FileLocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public static function getIsAbsolutePathTests(): array
['\\server\\foo.xml'],
['https://server/foo.xml'],
['phar://server/foo.xml'],
['phar:///server/foo.xml'],
];
}

Expand Down

0 comments on commit 977c88a

Please sign in to comment.