From ff46816e798fa16691f6ef2fb23f7f7b700c7670 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 21 Apr 2016 11:00:41 +0100 Subject: [PATCH] Add support for file:///c:/-style paths, refs #3338 --- src/Composer/Util/Filesystem.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Util/Filesystem.php b/src/Composer/Util/Filesystem.php index fd29d5218..c06b70b54 100644 --- a/src/Composer/Util/Filesystem.php +++ b/src/Composer/Util/Filesystem.php @@ -471,13 +471,13 @@ class Filesystem */ public static function isLocalPath($path) { - return (bool) preg_match('{^(file://|/|[a-z]:[\\\\/]|\.\.[\\\\/]|[a-z0-9_.-]+[\\\\/])}i', $path); + return (bool) preg_match('{^(file://|/|/?[a-z]:[\\\\/]|\.\.[\\\\/]|[a-z0-9_.-]+[\\\\/])}i', $path); } public static function getPlatformPath($path) { if (Platform::isWindows()) { - $path = preg_replace('{^(?:file:///([a-z])/)}i', 'file://$1:/', $path); + $path = preg_replace('{^(?:file:///([a-z]):?/)}i', 'file://$1:/', $path); } return preg_replace('{^file://}i', '', $path);