2
0
forked from Wavyzz/dolibarr

FIX dol_compress_dir names files on archives

This commit is contained in:
GregM
2022-07-11 16:18:56 +02:00
parent 840d9b182b
commit 8e57d04f94

View File

@@ -2193,7 +2193,7 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles =
if (!$file->isDir()) {
// Get real and relative path for current file
$filePath = $file->getRealPath();
$relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr($filePath, strlen($inputdir) + 1);
$relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr($filePath, strlen(realpath($inputdir)) + 1);
if (empty($excludefiles) || !preg_match($excludefiles, $filePath)) {
// Add current file to archive