]> git.mxchange.org Git - friendica.git/commitdiff
Fixed meaning of "maximagesize" = 0 --> infinity
authorMarek Bachmann <marek.bachmann@comtec.eecs.uni-kassel.de>
Wed, 30 Nov 2022 01:16:04 +0000 (02:16 +0100)
committerMarek Bachmann <marek.bachmann@comtec.eecs.uni-kassel.de>
Wed, 30 Nov 2022 01:16:04 +0000 (02:16 +0100)
mod/photos.php

index 8671c39495dc8cd0aefb1b1fb662b9fd9c3345c3..d31f8daab5986af01af49c755769a58164f62e0c 100644 (file)
@@ -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);