X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fimagefile.php;h=1a23d7b5ab9f9f8535d46e9d5ab49d7bb742b2d1;hb=d6b28c64830f632bb2f4b6f3c9369b9e56ad217a;hp=03a2280e59df19be9abd0d33150ff5d4bb90ae4a;hpb=8f0a5ffd57459352e178eed60709e350a09554b7;p=quix0rs-gnu-social.git diff --git a/lib/imagefile.php b/lib/imagefile.php index 03a2280e59..1a23d7b5ab 100644 --- a/lib/imagefile.php +++ b/lib/imagefile.php @@ -124,7 +124,7 @@ class ImageFile $imgPath = null; $media = common_get_mime_media($file->mimetype); if (Event::handle('CreateFileImageThumbnailSource', array($file, &$imgPath, $media))) { - if (empty($file->filename)) { + if (empty($file->filename) && !file_exists($imgPath)) { throw new UnsupportedMediaException(_('File without filename could not get a thumbnail source.')); } @@ -188,6 +188,8 @@ class ImageFile case UPLOAD_ERR_NO_FILE: // No file; probably just a non-AJAX submission. + throw new ClientException(_('No file uploaded.')); + default: common_log(LOG_ERR, __METHOD__ . ": Unknown upload error " . $_FILES[$param]['error']); // TRANS: Exception thrown when uploading an image fails for an unknown reason.