Skip to content

Commit 4f00d6f

Browse files
[Config] Handle Phar absolute path in FileLocator
1 parent f41aa69 commit 4f00d6f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/Symfony/Component/Config/FileLocator.php

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ private function isAbsolutePath(string $file): bool
8585
&& ('\\' === $file[2] || '/' === $file[2])
8686
)
8787
|| parse_url($file, \PHP_URL_SCHEME)
88+
|| str_starts_with($file, 'phar:///') // "parse_url()" doesn't handle absolute phar path, despite being valid
8889
) {
8990
return true;
9091
}

src/Symfony/Component/Config/Tests/FileLocatorTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public static function getIsAbsolutePathTests(): array
3939
['\\server\\foo.xml'],
4040
['https://server/foo.xml'],
4141
['phar://server/foo.xml'],
42+
['phar:///server/foo.xml'],
4243
];
4344
}
4445

0 commit comments

Comments
 (0)