Skip to content

Commit

Permalink
Adding array_filter to handle the scenario where mediatypes is an emp…
Browse files Browse the repository at this point in the history
…ty string, and reformatting for line length.
  • Loading branch information
mattelkins-bluefrontier committed Aug 14, 2024
1 parent 6079aa7 commit 72f667f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion administrator/components/com_media/src/Model/ApiModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,12 @@ private function isMediaFile($path)
// Initialize the allowed extensions
if ($this->allowedExtensions === null) {
// Get options from the input or fallback to all supported formats
$mediaTypes = explode(',', Factory::getApplication()->getInput()->getString('mediatypes', '0,1,2,3'));
$mediaTypes = array_filter(explode(
',',
Factory::getApplication()
->getInput()
->getString('mediatypes', '0,1,2,3')
));
$types = [];
$extensions = [];

Expand Down

0 comments on commit 72f667f

Please sign in to comment.