From 0b8bc44d7afc8c7249c697a7584fc9d1646e7c4d Mon Sep 17 00:00:00 2001 From: Jerome Jutteau Date: Tue, 5 Jul 2022 00:33:43 +0200 Subject: [PATCH 1/1] [BUGFIX] jirafeau_ini_to_bytes with no modifier When setting a PHP ini value like `post_max_size`, the value may not have a modifier (e.g. "M") and for "0" input, the function return empty string. Signed-off-by: Jerome Jutteau --- lib/functions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/functions.php b/lib/functions.php index cfc7dce..1e084fb 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -190,6 +190,9 @@ function jirafeau_ini_to_bytes($value) $modifier = substr($value, -1); $bytes = substr($value, 0, -1); switch (strtoupper($modifier)) { + default: + return intval($value); + break; case 'P': $bytes *= 1024; // no break @@ -243,7 +246,6 @@ function jirafeau_get_max_upload_chunk_size_bytes($max_upload_chunk_size_bytes = } return $size; } - $size = min( jirafeau_get_max_upload_size_bytes(), $max_upload_chunk_size_bytes -- 2.34.1