From 2b1ba26d2c294ca049d643a329a01d12d5faec64 Mon Sep 17 00:00:00 2001 From: Mauro Cassani Date: Mon, 13 Jan 2025 11:33:56 +0100 Subject: [PATCH] Mime type not allowed message (#3722) * Mime type not allowed message * Fix: css upload error label --------- Co-authored-by: riccio82 --- lib/Utils/API/Upload.php | 2 +- lib/View/fileupload/upload.class.php | 2 +- public/css/sass/upload-page.scss | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Utils/API/Upload.php b/lib/Utils/API/Upload.php index 02269aabb7..8bf8c1778e 100644 --- a/lib/Utils/API/Upload.php +++ b/lib/Utils/API/Upload.php @@ -191,7 +191,7 @@ protected function _uploadFile( $fileUp ) { if ( !$this->_isRightMime( $fileUp ) ) { $this->setObjectErrorOrThrowException( $fileUp, - new Exception ( __METHOD__ . " -> Mime type Not Allowed. '" . $out_filename . "'" ) + new Exception ( __METHOD__ . " -> File format not supported. '" . $out_filename . "'" ) ); } diff --git a/lib/View/fileupload/upload.class.php b/lib/View/fileupload/upload.class.php index 5a720f71b9..3e573a8a13 100644 --- a/lib/View/fileupload/upload.class.php +++ b/lib/View/fileupload/upload.class.php @@ -156,7 +156,7 @@ protected function validate( $uploaded_file, $file, $error, $index ) { if ( $file->type !== null ) { if ( !$this->_isRightMime( $file ) && ( !isset( $file->error ) || empty( $file->error ) ) ) { - $file->error = "Mime type Not Allowed"; + $file->error = "File format not supported"; return false; } diff --git a/public/css/sass/upload-page.scss b/public/css/sass/upload-page.scss index 35e38c838a..3283d4a80a 100644 --- a/public/css/sass/upload-page.scss +++ b/public/css/sass/upload-page.scss @@ -1,3 +1,5 @@ +@import "commons/colors"; + body { margin: 0; padding: 0; @@ -1082,6 +1084,10 @@ tr.ready .size span { visibility: visible; } +.file_upload_error { + color: $redDefault; +} + .more { margin-bottom: 5px; float: left;