X-Git-Url: https://git.mxchange.org/?p=quix0rs-gnu-social.git;a=blobdiff_plain;f=lib%2Fimagefile.php;fp=lib%2Fimagefile.php;h=53f676de2996f3fc365d44be9f7854a04cd6a5bf;hp=d967af1d8c43b62b99176140088f8cca9511ed8d;hb=4160a3fb730113f3d712bd777884c4b0482f6df1;hpb=abd90bbdf562614755802885dfb5673645df8575 diff --git a/lib/imagefile.php b/lib/imagefile.php index d967af1d8c..53f676de29 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.