From 486ca59f8644d91c42dea29054b85859fb0390ed Mon Sep 17 00:00:00 2001 From: Alexandros Sigalas Date: Wed, 6 Mar 2019 14:12:52 +0200 Subject: [PATCH] Fixed, PHP Warning: Invalid argument supplied for foreach(),cast array --- filemanager/inc/class.filemanager_hooks.inc.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/filemanager/inc/class.filemanager_hooks.inc.php b/filemanager/inc/class.filemanager_hooks.inc.php index af44a039fb..6753611234 100644 --- a/filemanager/inc/class.filemanager_hooks.inc.php +++ b/filemanager/inc/class.filemanager_hooks.inc.php @@ -235,18 +235,14 @@ class filemanager_hooks $editorLink = self::getEditorLink(); $mimes = array(); - if (is_array($editorLink['mime'])){ + foreach ((array)$editorLink['mime'] as $mime => $value) + { + $mimes[$mime] = lang('%1 file', strtoupper($value['ext'])).' ('.$mime.')'; - foreach ($editorLink['mime'] as $mime => $value) + if (!empty($value['extra_extensions'])) { - $mimes[$mime] = lang('%1 file', strtoupper($value['ext'])).' ('.$mime.')'; - - if (!empty($value['extra_extensions'])) - { - $mimes[$mime] .= ', '.strtoupper(implode(', ', $value['extra_extensions'])); - } + $mimes[$mime] .= ', '.strtoupper(implode(', ', $value['extra_extensions'])); } - } $merge_open_handler = array ('download' => lang('download'), 'collabora' => 'Collabora');