From: Diogo Cordeiro Date: Tue, 23 Jul 2019 21:23:54 +0000 (+0100) Subject: [Media] Fix undefined variable box in imagefile.php X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7044f0e2cf1525ac73e8f295f66d980cafef9387;p=quix0rs-gnu-social.git [Media] Fix undefined variable box in imagefile.php --- diff --git a/lib/imagefile.php b/lib/imagefile.php index 641d5d558a..590f95a739 100644 --- a/lib/imagefile.php +++ b/lib/imagefile.php @@ -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')