diff --git a/Path.php b/Path.php index 858e1623e..eb6d8ea08 100644 --- a/Path.php +++ b/Path.php @@ -368,7 +368,7 @@ public static function isAbsolute(string $path): bool } // Strip scheme - if (false !== $schemeSeparatorPosition = strpos($path, '://')) { + if (false !== ($schemeSeparatorPosition = strpos($path, '://')) && 1 !== $schemeSeparatorPosition) { $path = substr($path, $schemeSeparatorPosition + 3); } diff --git a/Tests/PathTest.php b/Tests/PathTest.php index 77b9f2a2d..17c6142c3 100644 --- a/Tests/PathTest.php +++ b/Tests/PathTest.php @@ -375,6 +375,8 @@ public static function provideIsAbsolutePathTests(): \Generator yield ['C:/css/style.css', true]; yield ['D:/', true]; + yield ['C:///windows', true]; + yield ['C://test', true]; yield ['E:\\css\\style.css', true]; yield ['F:\\', true];