Fixed, PHP message: PHP Warning: Invalid argument supplied for foreach()

This commit is contained in:
Alexandros Sigalas 2019-03-05 22:46:07 +02:00
parent a154557512
commit 6175e88048

View File

@ -236,15 +236,21 @@ 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']))
if (is_array($editorLink['mime'])){
foreach ($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(