Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e37bdf0

Browse filesBrowse files
bug #58713 [Config] Handle Phar absolute path in FileLocator (alexandre-daubois)
This PR was merged into the 5.4 branch. Discussion ---------- [Config] Handle Phar absolute path in `FileLocator` | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #58708 | License | MIT Commits ------- 4f00d6f [Config] Handle Phar absolute path in `FileLocator`
2 parents 454c49b + 4f00d6f commit e37bdf0
Copy full SHA for e37bdf0

File tree

Expand file treeCollapse file tree

2 files changed

+2
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+2
-0
lines changed

‎src/Symfony/Component/Config/FileLocator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/FileLocator.php
+1Lines changed: 1 addition & 0 deletions
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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Tests/FileLocatorTest.php
+1Lines changed: 1 addition & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.