]> git.mxchange.org Git - friendica.git/commitdiff
using constant value for calculation of MiB output, really no need to calculate 2...
authorMarek Bachmann <marek.bachmann@comtec.eecs.uni-kassel.de>
Sat, 26 Nov 2022 22:44:23 +0000 (23:44 +0100)
committerMarek Bachmann <marek.bachmann@comtec.eecs.uni-kassel.de>
Sat, 26 Nov 2022 22:44:23 +0000 (23:44 +0100)
mod/photos.php

index 2aa2302a50a094e2f7cc5d5158fdaf088f887619..4bca8275e3427d0c197591ca29c830b6739944af 100644 (file)
@@ -920,9 +920,7 @@ function photos_content(App $a)
                $umf_bytes = Strings::getBytesFromShorthand(ini_get('upload_max_filesize'));
 
                // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit.
-               (($umf_bytes < $mis_bytes) || ! is_numeric($mis_bytes)) ?
-                       ($maximagesize_Mbytes = ($umf_bytes / 1048576)) : ($maximagesize_Mbytes = ($mis_bytes / 1048576));
-
+               $maximagesize_Mbytes = (is_numeric($mis_bytes) && ($mis_bytes < $umf_bytes) ? $mis_bytes : $umf_bytes) / (1048576);
 
                $usage_message = DI::l10n()->t('The maximum accepted image size is %.3g MB', $maximagesize_Mbytes);