Skip to content

Commit

Permalink
Fix Deprecated: explode() when upload a file (FE) jmcameron#64
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mckillo committed Aug 27, 2024
1 parent b315d25 commit fa94560
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions attachments_component/site/src/Helper/AttachmentsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit fa94560

Please sign in to comment.