diff --git a/libraries/src/Helper/MediaHelper.php b/libraries/src/Helper/MediaHelper.php index ac70f62faaa3c..57873e9f25c19 100644 --- a/libraries/src/Helper/MediaHelper.php +++ b/libraries/src/Helper/MediaHelper.php @@ -207,7 +207,7 @@ public function canUpload($file, $component = 'com_media', $allowedExecutables = $filetype = array_pop($filetypes); - $allowable = array_map('trim', explode(',', $params->get('restrict_uploads_extensions'))); + $allowable = array_map('trim', explode(',', $params->get('restrict_uploads_extensions', 'bmp,gif,jpg,jpeg,png,webp,ico,mp3,m4a,mp4a,ogg,mp4,mp4v,mpeg,mov,odg,odp,ods,odt,pdf,png,ppt,txt,xcf,xls,csv'))); $ignored = array_map('trim', explode(',', $params->get('ignore_extensions'))); if ($filetype == '' || $filetype == false || (!\in_array($filetype, $allowable) && !\in_array($filetype, $ignored))) @@ -228,7 +228,7 @@ public function canUpload($file, $component = 'com_media', $allowedExecutables = if ($params->get('restrict_uploads', 1)) { - $allowedExtensions = array_map('trim', explode(',', $params->get('restrict_uploads_extensions'))); + $allowedExtensions = array_map('trim', explode(',', $params->get('restrict_uploads_extensions', 'bmp,gif,jpg,jpeg,png,webp,ico,mp3,m4a,mp4a,ogg,mp4,mp4v,mpeg,mov,odg,odp,ods,odt,pdf,png,ppt,txt,xcf,xls,csv'))); if (\in_array($filetype, $allowedExtensions)) { diff --git a/plugins/editors-xtd/image/image.php b/plugins/editors-xtd/image/image.php index 6a8097930c42d..fdf16941b8b6d 100644 --- a/plugins/editors-xtd/image/image.php +++ b/plugins/editors-xtd/image/image.php @@ -49,7 +49,8 @@ public function onDisplay($name, $asset, $author) $extension = $app->input->get('option'); // For categories we check the extension (ex: component.section) - if ($extension === 'com_categories') { + if ($extension === 'com_categories') + { $parts = explode('.', $app->input->get('extension', 'com_content')); $extension = $parts[0]; } @@ -63,7 +64,8 @@ public function onDisplay($name, $asset, $author) || ($user->authorise('core.edit.own', $asset) && $author === $user->id) || (count($user->getAuthorisedCategories($extension, 'core.edit')) > 0) || (count($user->getAuthorisedCategories($extension, 'core.edit.own')) > 0 && $author === $user->id) - ) { + ) + { $doc->getWebAssetManager() ->useScript('webcomponent.media-select') ->useScript('webcomponent.field-media') @@ -73,7 +75,8 @@ public function onDisplay($name, $asset, $author) $name . '_ImageModal', ]); - if (count($doc->getScriptOptions('media-picker')) === 0) { + if (count($doc->getScriptOptions('media-picker')) === 0) + { $imagesExt = array_map( 'trim', explode(