From 97812549b99aaae5b94f5f4b538ddc5484c28fdf Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Mon, 26 Jan 2015 01:16:28 +0100 Subject: [PATCH] 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. --- lib/imagefile.php | 3 +++ 1 file changed, 3 insertions(+) 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();