From 8e57d04f94ac82825175296c668ea70623c48ec4 Mon Sep 17 00:00:00 2001 From: GregM Date: Mon, 11 Jul 2022 16:18:56 +0200 Subject: [PATCH] FIX dol_compress_dir names files on archives --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index f774982b240..21c290b595d 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -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