From f45b3583932728bc4a04964d0bcab94334797e94 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Sat, 26 Nov 2022 23:44:23 +0100 Subject: [PATCH] using constant value for calculation of MiB output, really no need to calculate 2**20 for just dividing the bytes by one constant divisor. --- mod/photos.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index 2aa2302a50..4bca8275e3 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -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);