]> git.mxchange.org Git - friendica.git/commitdiff
Wrapped all occurrences of DI::config()->get('system', 'maximagesize') with Strings...
authorMarek Bachmann <marek.bachmann@comtec.eecs.uni-kassel.de>
Wed, 30 Nov 2022 01:26:56 +0000 (02:26 +0100)
committerMarek Bachmann <marek.bachmann@comtec.eecs.uni-kassel.de>
Wed, 30 Nov 2022 01:26:56 +0000 (02:26 +0100)
src/Model/Photo.php

index 990fb7e616b9f2cb968bf8adbb4477d7afba6732..967c58e2ab009530cc449d2d276a508835d16fb2 100644 (file)
@@ -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