- /* This block determines which setting actually limits upload size of images:
- * limit of Friendica ('maximagesize') or upload_max_filesize
- * and outputs the lower one.
- */
- $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 = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
+ $umf_bytes = Strings::getBytesFromShorthand(ini_get('upload_max_filesize'));
+
+ // Per Friendica definition a value of '0' means unlimited:
+ If ($mis_bytes == 0) {
+ $mis_bytes = INF;