8000 bug #54759 [Filesystem] better distinguish URL schemes and Windows dr… · symfony/symfony@6be16ad · GitHub
[go: up one dir, main page]

Skip to content

Commit 6be16ad

Browse files
committed
bug #54759 [Filesystem] better distinguish URL schemes and Windows drive letters (xabbuh)
This PR was merged into the 5.4 branch. Discussion ---------- [Filesystem] better distinguish URL schemes and Windows drive letters | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #45485 | License | MIT Commits ------- f456e75 better distinguish URL schemes and windows drive letters
2 parents ad82c43 + f456e75 commit 6be16ad

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Symfony/Component/Filesystem/Path.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ public static function isAbsolute(string $path): bool
368368
}
369369

370370
// Strip scheme
371-
if (false !== $schemeSeparatorPosition = strpos($path, '://')) {
371+
if (false !== ($schemeSeparatorPosition = strpos($path, '://')) && 1 !== $schemeSeparatorPosition) {
372372
$path = substr($path, $schemeSeparatorPosition + 3);
373373
}
374374

src/Symfony/Component/Filesystem/Tests/PathTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ public static function provideIsAbsolutePathTests(): \Generator
375375

376376
yield ['C:/css/style.css', true];
377377
yield ['D:/', true];
378+
yield ['C:///windows', true];
379+
yield ['C://test', true];
378380

379381
yield ['E:\\css\\style.css', true];
380382
yield ['F:\\', true];

0 commit comments

Comments
 (0)
0