From: Mikael Nordfeldth Date: Mon, 26 Jan 2015 00:16:28 +0000 (+0100) Subject: Unnecessarily spammy logs for getThumbnail() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=97812549b99aaae5b94f5f4b538ddc5484c28fdf;p=quix0rs-gnu-social.git Unnecessarily spammy logs for getThumbnail() When trying to create thumbnails for remote media that don't have the filename field set, we got a lot of output in the debug log. --- diff --git a/lib/imagefile.php b/lib/imagefile.php index 6aeab35816..2dc260b1bf 100644 --- a/lib/imagefile.php +++ b/lib/imagefile.php @@ -110,6 +110,9 @@ class ImageFile $imgPath = null; $media = common_get_mime_media($file->mimetype); if (Event::handle('CreateFileImageThumbnailSource', array($file, &$imgPath, $media))) { + if (empty($file->filename)) { + throw new UnsupportedMediaException(_('File without filename could not get a thumbnail source.')); + } switch ($media) { case 'image': $imgPath = $file->getPath();