Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.1] Ensure isMediaFile defaults to all supported formats when mediatypes is not specified #43640

Open
wants to merge 1 commit into
base: 5.1-dev
Choose a base branch
from
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
Default to all supported formats.
  • Loading branch information
mattelkins-bluefrontier committed Jun 10, 2024
commit fcb26d58d62f0b36ba166a567c933c9559711537
9 changes: 2 additions & 7 deletions administrator/components/com_media/src/Model/ApiModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down