1
0
Fork 0

Fix 7zip issues on windows when mixing forward and backslashes, fixes #10058

pull/10065/head
Jordi Boggiano 2021-08-18 11:55:51 +02:00
parent b7bb7718fb
commit 5c201687e5
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 6 additions and 0 deletions

View File

@ -115,6 +115,12 @@ class ZipDownloader extends ArchiveDownloader
$commandSpec = reset(self::$unzipCommands);
$command = sprintf($commandSpec[1], ProcessExecutor::escape($file), ProcessExecutor::escape($path));
// normalize separators to backslashes to avoid problems with 7-zip on windows
// see https://github.com/composer/composer/issues/10058
if (Platform::isWindows()) {
$command = sprintf($commandSpec[1], ProcessExecutor::escape(strtr($file, '/', '\\')), ProcessExecutor::escape(strtr($path, '/', '\\')));
}
$executable = $commandSpec[0];
$self = $this;