Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions administrator/components/com_media/src/Model/ApiModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,15 @@ 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 = array_filter(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback was hardcoded to 0 (images) for backward compatibility. Changing this needs to be done in a major version and after checking that it won’t break the majority of 3rd party extensions. Also it needs a good communication… fwiw I don’t know what exactly it would solve to allow everything by default, good systems are usually restricted by default…

explode(
',',
Factory::getApplication()
->getInput()
->getString('mediatypes', '0,1,2,3')
)
);
$types = [];
$extensions = [];

Expand Down