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.
This commit is contained in:
Mikael Nordfeldth 2015-01-26 01:16:28 +01:00
parent a8e613e508
commit 97812549b9
1 changed files with 3 additions and 0 deletions

View 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();