in() does not handle absolute paths under Windows

This fixes plugins to be included incorrectly under Windows
This commit is contained in:
Dimitrios Karvounaris
2020-06-02 18:33:53 +02:00
parent c05df43217
commit 83797431fb

View File

@ -61,7 +61,7 @@ final class UsesCall
$targets = array_map(function ($path): string { $targets = array_map(function ($path): string {
$startChar = DIRECTORY_SEPARATOR; $startChar = DIRECTORY_SEPARATOR;
if ('\\' === DIRECTORY_SEPARATOR) { if ('\\' === DIRECTORY_SEPARATOR || preg_match('~\A[A-Z]:(?![^/\\\\])~i', $path) > 0) {
$path = (string) preg_replace_callback('~^(?P<drive>[a-z]+:\\\)~i', function ($match): string { $path = (string) preg_replace_callback('~^(?P<drive>[a-z]+:\\\)~i', function ($match): string {
return strtolower($match['drive']); return strtolower($match['drive']);
}, $path); }, $path);