fix getting bytes from shorthand in php

This commit is contained in:
Jakobus Schürz 2023-03-14 16:35:18 +01:00
parent 721c065a44
commit 39f7660a1d
10 changed files with 36 additions and 56 deletions

View file

@ -411,9 +411,7 @@ class Conversation
'$always_open_compose' => $this->pConfig->get($this->session->getLocalUserId(), 'frio', 'always_open_compose', false),
// Dropzone
//'$max_imagesize' => Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
// Strings::getBytresFromShorthand not working, so just workaround in template and serve the bare value
'$max_imagesize' => DI::config()->get('system', 'maximagesize'),
'$max_imagesize' => floor(\Friendica\Util\Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000),
]);

View file

@ -242,7 +242,7 @@ class Compose extends BaseModule
]),
// Dropzone
'$max_imagesize' => DI::config()->get('system', 'maximagesize')
'$max_imagesize' => floor(Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000),
]);
}
}

View file

@ -184,13 +184,10 @@ class Edit extends BaseModule
'$shortpermset' => $this->t('Permissions'),
'$compose_link_title' => $this->t('Open Compose page'),
// Dropzone
//'$max_imagesize' => \Friendica\\Util\\Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
//'$max_imagesize' => Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
// both not working, so just workaround in template and serve the bare value
'$max_imagesize' => DI::config()->get('system', 'maximagesize'),
]);
// Dropzone
'$max_imagesize' => floor(Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000),
]);
return $output;
}

View file

@ -1070,9 +1070,7 @@ class Post
'$indent' => $indent,
'$rand_num' => Crypto::randomDigits(12),
// Dropzone
//'$max_imagesize' => Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize'));
// Strings::getBytresFromShorthand not working, so just workaround in template and serve the bare value
'$max_imagesize' => DI::config()->get('system', 'maximagesize'),
'$max_imagesize' => floor(\Friendica\Util\Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')) / 1000000),
]);
}