rollback dotclear Zip Unzip class

master
Jean-Christian Paul Denis 2023-04-27 22:05:44 +02:00
parent 589313f4ad
commit 9ebccfd8ba
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
2 changed files with 5 additions and 2 deletions

View File

@ -208,7 +208,8 @@ class zip extends Action
return; return;
} }
@set_time_limit(300); @set_time_limit(300);
$zip = new zip\Zip($path); $fp = fopen($path, 'wb');
$zip = new zip\Zip($fp);
foreach ($exclude as $e) { foreach ($exclude as $e) {
$e = '#(^|/)(' . str_replace( $e = '#(^|/)(' . str_replace(
['.', '*'], ['.', '*'],
@ -223,6 +224,7 @@ class zip extends Action
true true
); );
$zip->close(); $zip->close();
$zip->write();
unset($zip); unset($zip);
$this->setSuccess(sprintf(__('Zip module into "%s"'), $path)); $this->setSuccess(sprintf(__('Zip module into "%s"'), $path));

View File

@ -24,9 +24,10 @@ class Zip extends \Dotclear\Helper\File\Zip\Zip
* *
* @param string $name The name * @param string $name The name
* @param string $file The file * @param string $file The file
* @param string $size The size
* @param int|null $mtime The mtime * @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])) { if (!isset($this->entries[$name])) {
return; return;