From 9ebccfd8ba1fa4c7df15d7dce49c5e1883218f01 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Thu, 27 Apr 2023 22:05:44 +0200 Subject: [PATCH] rollback dotclear Zip Unzip class --- src/module/zip.php | 4 +++- src/module/zip/Zip.php | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/module/zip.php b/src/module/zip.php index e64cea1..7e11a64 100644 --- a/src/module/zip.php +++ b/src/module/zip.php @@ -208,7 +208,8 @@ class zip extends Action return; } @set_time_limit(300); - $zip = new zip\Zip($path); + $fp = fopen($path, 'wb'); + $zip = new zip\Zip($fp); foreach ($exclude as $e) { $e = '#(^|/)(' . str_replace( ['.', '*'], @@ -223,6 +224,7 @@ class zip extends Action true ); $zip->close(); + $zip->write(); unset($zip); $this->setSuccess(sprintf(__('Zip module into "%s"'), $path)); diff --git a/src/module/zip/Zip.php b/src/module/zip/Zip.php index c533d42..a281006 100644 --- a/src/module/zip/Zip.php +++ b/src/module/zip/Zip.php @@ -24,9 +24,10 @@ class Zip extends \Dotclear\Helper\File\Zip\Zip * * @param string $name The name * @param string $file The file + * @param string $size The size * @param int|null $mtime The mtime */ - protected function writeFile(string $name, string $file, ?int $mtime) + protected function writeFile($name, $file, $size, $mtime) { if (!isset($this->entries[$name])) { return;