From bbd1c34292e8ac0d4d0b879b0fe57fb69a0c7841 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 02:26:56 +0100 Subject: [PATCH] Wrapped all occurrences of DI::config()->get('system', 'maximagesize') with Strings::getBytesFromShorthand() --- src/Model/Photo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Photo.php b/src/Model/Photo.php index 990fb7e61..967c58e2a 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -575,7 +575,7 @@ class Photo $image->scaleToSquare(300); $filesize = strlen($image->asString()); - $maximagesize = DI::config()->get('system', 'maximagesize'); + $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); if (!empty($maximagesize) && ($filesize > $maximagesize)) { Logger::info('Avatar exceeds image limit', ['uid' => $uid, 'cid' => $cid, 'maximagesize' => $maximagesize, 'size' => $filesize, 'type' => $image->getType()]); if ($image->getType() == 'image/gif') { @@ -966,7 +966,7 @@ class Photo $width = $image->getWidth(); $height = $image->getHeight(); - $maximagesize = DI::config()->get('system', 'maximagesize'); + $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); if (!empty($maximagesize) && ($filesize > $maximagesize)) { // Scale down to multiples of 640 until the maximum size isn't exceeded anymore