From fa94560bc92daf1354fbbc65736d8c7523d266e2 Mon Sep 17 00:00:00 2001 From: McKillo Date: Tue, 27 Aug 2024 07:26:57 +0200 Subject: [PATCH] Fix Deprecated: explode() when upload a file (FE) #64 In Jooonla 5, the upload_mime_illegal key doesn't exist in the params of com_media and its reference is deleted in the code. --- attachments_component/site/src/Helper/AttachmentsHelper.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/attachments_component/site/src/Helper/AttachmentsHelper.php b/attachments_component/site/src/Helper/AttachmentsHelper.php index 96a581f9..93d0bb8d 100644 --- a/attachments_component/site/src/Helper/AttachmentsHelper.php +++ b/attachments_component/site/src/Helper/AttachmentsHelper.php @@ -639,9 +639,7 @@ public static function upload_file(&$attachment, &$parent, $attachment_id=false, if ( $cmparams->get('restrict_uploads',true) ) { if ( $cmparams->get('check_mime', true) ) { $allowed_mime = explode(',', $cmparams->get('upload_mime')); - $illegal_mime = explode(',', $cmparams->get('upload_mime_illegal')); - if ( StringHelper::strlen($ftype) && !in_array($ftype, $allowed_mime) && - in_array($ftype, $illegal_mime) ) { + if ( StringHelper::strlen($ftype) && !in_array($ftype, $allowed_mime)) { $error = 'illegal_mime_type'; $error_msg = Text::sprintf('ATTACH_ERROR_UPLOADING_FILE_S', $filename); $error_msg .= ', ' . Text::_('ATTACH_ERROR_ILLEGAL_FILE_MIME_TYPE') . " $ftype";