Merge pull request #64 from asig2016/17.1_fix1

Fixed, PHP Warning: Invalid argument supplied for foreach(), cast array
This commit is contained in:
Ralf Becker 2019-03-06 13:23:37 +01:00 committed by GitHub
commit 5d3d3a9930
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -236,15 +236,18 @@ class filemanager_hooks
}
$editorLink = self::getEditorLink();
$mimes = array();
foreach ($editorLink['mime'] as $mime => $value)
{
$mimes[$mime] = lang('%1 file', strtoupper($value['ext'])).' ('.$mime.')';
if (!empty($value['extra_extensions']))
foreach ((array)$editorLink['mime'] as $mime => $value)
{
$mimes[$mime] .= ', '.strtoupper(implode(', ', $value['extra_extensions']));
$mimes[$mime] = lang('%1 file', strtoupper($value['ext'])).' ('.$mime.')';
if (!empty($value['extra_extensions']))
{
$mimes[$mime] .= ', '.strtoupper(implode(', ', $value['extra_extensions']));
}
}
}
asort($mimes);
$settings += array (
'sections.2' => array(