From fcb26d58d62f0b36ba166a567c933c9559711537 Mon Sep 17 00:00:00 2001 From: Matt Elkins Date: Mon, 10 Jun 2024 19:04:28 +0100 Subject: [PATCH] Default to all supported formats. --- .../components/com_media/src/Model/ApiModel.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/administrator/components/com_media/src/Model/ApiModel.php b/administrator/components/com_media/src/Model/ApiModel.php index 0adea37276b5d..b0cd4e2536acd 100644 --- a/administrator/components/com_media/src/Model/ApiModel.php +++ b/administrator/components/com_media/src/Model/ApiModel.php @@ -451,16 +451,11 @@ private function isMediaFile($path) // Initialize the allowed extensions if ($this->allowedExtensions === null) { - // Get options from the input or fallback to images only - $mediaTypes = explode(',', Factory::getApplication()->getInput()->getString('mediatypes', '0')); + // Get options from the input or fallback to all supported formats + $mediaTypes = explode(',', Factory::getApplication()->getInput()->getString('mediatypes', '0,1,2,3')); $types = []; $extensions = []; - // Default to showing all supported formats - if (\count($mediaTypes) === 0) { - $mediaTypes = ['0', '1', '2', '3']; - } - array_map( function ($mediaType) use (&$types) { switch ($mediaType) {