MDL-74641 repository: Fix wrong increment of temporary file for small sizes

This commit is contained in:
meirzamoodle 2024-01-24 11:58:50 +08:00 committed by Jenkins
parent 9ba1423359
commit a73e0ac76d

View File

@ -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';