From 45d38d883312fccbacb49eac6827a975236d3f09 Mon Sep 17 00:00:00 2001 From: Matthew Barbour Date: Mon, 26 Oct 2020 07:25:15 -0500 Subject: [PATCH] Added more specific upload error message that includes detected mimetype --- ext/cron_uploader/main.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/cron_uploader/main.php b/ext/cron_uploader/main.php index f43c12dd..be707e4c 100644 --- a/ext/cron_uploader/main.php +++ b/ext/cron_uploader/main.php @@ -462,6 +462,9 @@ class CronUploader extends Extension // Generate info message if ($event->image_id == -1) { + if(array_key_exists("mime",$event->metadata)) { + throw new UploadException("File type not recognised (".$event->metadata["mime"]."). Filename: {$filename}"); + } throw new UploadException("File type not recognised. Filename: {$filename}"); } elseif ($event->merged === true) { $infomsg = "Image merged. ID: {$event->image_id} - Filename: {$filename}";