Added getBytesFromShorthand at the remaining places.

This commit is contained in:
Marek Bachmann 2022-11-30 04:13:10 +01:00
parent 97a3587e58
commit bb9afc520b
2 changed files with 11 additions and 2 deletions

View file

@ -53,7 +53,11 @@ class Index extends BaseSettings
$filetype = Images::getMimeTypeBySource($src, $filename, $filetype);
$maximagesize = DI::config()->get('system', 'maximagesize', 0);
$maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize', 0));
if ($maximagesize == 0) {
$maximagesize = INF;
}
if ($maximagesize && $filesize > $maximagesize) {
DI::sysmsg()->addNotice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)));