From 38e5b3cfef39a203954102f3f291c500decd4f28 Mon Sep 17 00:00:00 2001 From: bbbboom Date: Fri, 7 Apr 2023 08:58:13 +0800 Subject: [PATCH] Fix a zip error Fix Fatal error: Uncaught ValueError: fread(): Argument #2 ($length) must be greater than 0 in /app/kod/archiveLib/pclzip.class.php:2704 --- app/kod/archiveLib/pclzip.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/kod/archiveLib/pclzip.class.php b/app/kod/archiveLib/pclzip.class.php index ea46330..d96356f 100755 --- a/app/kod/archiveLib/pclzip.class.php +++ b/app/kod/archiveLib/pclzip.class.php @@ -2700,7 +2700,10 @@ } // ----- Read the file content - $v_content = @fread($v_file, $p_header['size']); + $v_content = ''; + if ($p_header['size'] > 0) { + $v_content = @fread($v_file, $p_header['size']); + } // ----- Close the file @fclose($v_file);