]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Unnecessarily spammy logs for getThumbnail()
authorMikael Nordfeldth <mmn@hethane.se>
Mon, 26 Jan 2015 00:16:28 +0000 (01:16 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 26 Jan 2015 00:16:28 +0000 (01:16 +0100)
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

index 6aeab35816e3b3ca399ecd0683fac93e3b1680a4..2dc260b1bf8cad511abe131d254ab4648db659d8 100644 (file)
@@ -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();