Bugfix - ZIP Paths may starts with an (back-) slash

This commit is contained in:
SamBrishes 2020-05-14 11:33:46 +02:00
parent a5dc0addea
commit 06131d7f85
1 changed files with 2 additions and 2 deletions

View File

@ -175,9 +175,9 @@ class Filesystem {
foreach ($files as $file) { foreach ($files as $file) {
$file = realpath($file); $file = realpath($file);
if (is_dir($file)) { if (is_dir($file)) {
$zip->addEmptyDir(str_replace($source, '', $file)); $zip->addEmptyDir(ltrim(str_replace($source, '', $file), "/\\"));
} elseif (is_file($file)) { } elseif (is_file($file)) {
$zip->addFromString(str_replace($source, '', $file), file_get_contents($file)); $zip->addFromString(ltrim(str_replace($source, '', $file), "/\\"), file_get_contents($file));
} }
} }
} elseif (is_file($source)) { } elseif (is_file($source)) {