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 6be16ad

Browse filesBrowse 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
Copy full SHA for 6be16ad

File tree

Expand file treeCollapse file tree

2 files changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-1
lines changed

‎src/Symfony/Component/Filesystem/Path.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Filesystem/Path.php
+1-1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Filesystem/Tests/PathTest.php
+2Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.