]> git.mxchange.org Git - friendica.git/commitdiff
Better formatting
authorMarek Bachmann <marek.bachmann@comtec.eecs.uni-kassel.de>
Sat, 26 Nov 2022 20:47:55 +0000 (21:47 +0100)
committerMarek Bachmann <marek.bachmann@comtec.eecs.uni-kassel.de>
Sat, 26 Nov 2022 20:47:55 +0000 (21:47 +0100)
mod/photos.php

index c2f0b6291e5d4ee4d6f1e6b69580e5174931a42c..d5689f5fd52bb501aad1ed9befa9ff94515c1f42 100644 (file)
@@ -914,22 +914,18 @@ function photos_content(App $a)
                        '$submit' => DI::l10n()->t('Submit'),
                ]);
 
-               /* This block determines which setting actually limits  upload size of images:
-                * limit of Friendica ('maximagesize') or upload_max_filesize
-                * and outputs the lower one.
-               */
+               // Determine which setting actually limits  upload size of images: limit of Friendica ('maximagesize') or upload_max_filesize
                $maximagesize_Mbytes = 0;
-               {
-                       // Get the relevant size limits for uploads. Abbreviated var names: MaxImageSize -> mis; upload_max_filesize -> umf
-                       $mis_bytes = DI::config()->get('system', 'maximagesize');
-                       $umf_bytes = Strings::getBytesFromShorthand(get_cfg_var('upload_max_filesize'));
-
-                       if (is_numeric($mis_bytes)) {
-                               // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit.
-                               ($umf_bytes < $mis_bytes) ?
-                                       ($maximagesize_Mbytes = ($umf_bytes / (10 ** 6))) : ($maximagesize_Mbytes = ($mis_bytes / (10 ** 6)));
-                       }
+               // Get the relevant size limits for uploads. Abbreviated var names: MaxImageSize -> mis; upload_max_filesize -> umf
+               $mis_bytes = DI::config()->get('system', 'maximagesize');
+               $umf_bytes = Strings::getBytesFromShorthand(get_cfg_var('upload_max_filesize'));
+
+               if (is_numeric($mis_bytes)) {
+                       // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit.
+                       ($umf_bytes < $mis_bytes) ?
+                               ($maximagesize_Mbytes = ($umf_bytes / (10 ** 6))) : ($maximagesize_Mbytes = ($mis_bytes / (10 ** 6)));
                }
+               
                $usage_message = DI::l10n()->t('The maximum accepted image size is %.3g MB', $maximagesize_Mbytes);
 
                $tpl = Renderer::getMarkupTemplate('photos_upload.tpl');