From 83797431fb3bf7a0f18da2392a7c81ce11d82d66 Mon Sep 17 00:00:00 2001 From: Dimitrios Karvounaris Date: Tue, 2 Jun 2020 18:33:53 +0200 Subject: [PATCH] in() does not handle absolute paths under Windows This fixes plugins to be included incorrectly under Windows --- src/PendingObjects/UsesCall.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PendingObjects/UsesCall.php b/src/PendingObjects/UsesCall.php index 56205be8..4523dab5 100644 --- a/src/PendingObjects/UsesCall.php +++ b/src/PendingObjects/UsesCall.php @@ -61,7 +61,7 @@ final class UsesCall $targets = array_map(function ($path): string { $startChar = DIRECTORY_SEPARATOR; - if ('\\' === DIRECTORY_SEPARATOR) { + if ('\\' === DIRECTORY_SEPARATOR || preg_match('~\A[A-Z]:(?![^/\\\\])~i', $path) > 0) { $path = (string) preg_replace_callback('~^(?P[a-z]+:\\\)~i', function ($match): string { return strtolower($match['drive']); }, $path);