From a73e0ac76d77b67602f91bb211962813d60bc573 Mon Sep 17 00:00:00 2001 From: meirzamoodle Date: Wed, 24 Jan 2024 11:58:50 +0800 Subject: [PATCH] MDL-74641 repository: Fix wrong increment of temporary file for small sizes --- lib/filestorage/zip_packer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/filestorage/zip_packer.php b/lib/filestorage/zip_packer.php index 482aea1096d..a982afae6a8 100644 --- a/lib/filestorage/zip_packer.php +++ b/lib/filestorage/zip_packer.php @@ -502,8 +502,8 @@ class zip_packer extends file_packer { $content = ''; while (!feof($fz)) { $content .= fread($fz, 262143); - $realfilesize += strlen($content); // Current file size. - $totalsizebytes += strlen($content); + $realfilesize = strlen($content); // Current file size. + $totalsizebytes = strlen($content); if ($realfilesize > $size || ($areamaxbytes != FILE_AREA_MAX_BYTES_UNLIMITED && $totalsizebytes > $areamaxbytes)) { $processed[0] = 'cannotunzipquotaexceeded';