From 2794100cbc3276f296237af5d4fd89738cccc29b Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 02:16:04 +0100 Subject: [PATCH] Fixed meaning of "maximagesize" = 0 --> infinity --- mod/photos.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod/photos.php b/mod/photos.php index 8671c39495..d31f8daab5 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -918,7 +918,10 @@ function photos_content(App $a) // Get the relevant size limits for uploads. Abbreviated var names: MaxImageSize -> mis; upload_max_filesize -> umf $mis_bytes = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); $umf_bytes = Strings::getBytesFromShorthand(ini_get('upload_max_filesize')); - + // Per Friendica definition a value of '0' mean unlimited: + If ($mis_bytes == 0) { + $mis_bytes = INF; + } // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit. $maximagesize_Mbytes = (is_numeric($mis_bytes) && ($mis_bytes < $umf_bytes) ? $mis_bytes : $umf_bytes) / (1048576);