]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
[Media] Fix undefined variable box in imagefile.php
authorDiogo Cordeiro <diogo@fc.up.pt>
Tue, 23 Jul 2019 21:23:54 +0000 (22:23 +0100)
committerDiogo Cordeiro <diogo@fc.up.pt>
Sat, 3 Aug 2019 16:47:23 +0000 (17:47 +0100)
lib/imagefile.php

index 641d5d558a559902e5195777508825847e2558f8..590f95a73923c6ce2ddda16ebc88c94130c6aeb6 100644 (file)
@@ -578,13 +578,16 @@ class ImageFile extends MediaFile
         $filename = MediaFile::decodeFilename(basename($this->filepath));
         // Encoding null makes the file use 'untitled', and also replaces the extension
         $outfilename = MediaFile::encodeFilename($filename, $this->filehash, $ext);
-        $outpath = File_thumbnail::path(
-            "thumb-{$this->fileRecord->id}-{$box['width']}x{$box['height']}-{$outfilename}");
 
         // The boundary box for our resizing
-        $box = array('width'=>$width, 'height'=>$height,
-                     'x'=>$x,         'y'=>$y,
-                     'w'=>$w,         'h'=>$h);
+        $box = [
+            'width'=>$width, 'height'=>$height,
+            'x'=>$x,         'y'=>$y,
+            'w'=>$w,         'h'=>$h
+        ];
+
+        $outpath = File_thumbnail::path(
+            "thumb-{$this->fileRecord->id}-{$box['width']}x{$box['height']}-{$outfilename}");
 
         // Doublecheck that parameters are sane and integers.
         if ($box['width'] < 1 || $box['width'] > common_config('thumbnail', 'maxsize')