From ecb612c726bc00733159507296eeb930bdbe4de1 Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Tue, 7 Jul 2009 22:29:59 +0200 Subject: [PATCH] [svn r21860] FS#2867 - The FCKEditor, the initialization script: Adding array-checks in the code for reading toolbar configuration data. --- main/inc/lib/fckeditor/fckeditor.php | 36 ++++++++++++++++------------ 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/main/inc/lib/fckeditor/fckeditor.php b/main/inc/lib/fckeditor/fckeditor.php index 5fefb75415..d225710fc4 100644 --- a/main/inc/lib/fckeditor/fckeditor.php +++ b/main/inc/lib/fckeditor/fckeditor.php @@ -362,12 +362,14 @@ class FCKeditor switch ($key) { case 'ToolbarSets': if (!empty($toolbar_set) && $toolbar_set != 'Default') { - foreach ($value as $toolbar_name => $toolbar_data) { - if ($toolbar_set == $toolbar_name || $toolbar_set_maximized == $toolbar_name) { - if (!isset($this->Config[$key][$toolbar_name])) { - $this->Config[$key][$toolbar_name] = $toolbar_data; + if (is_array($value)) { + foreach ($value as $toolbar_name => $toolbar_data) { + if ($toolbar_set == $toolbar_name || $toolbar_set_maximized == $toolbar_name) { + if (!isset($this->Config[$key][$toolbar_name])) { + $this->Config[$key][$toolbar_name] = $toolbar_data; + } + break; } - break; } } } @@ -376,24 +378,28 @@ class FCKeditor case 'ToolbarCanCollapse': case 'ToolbarStartExpanded': if (!empty($toolbar_set) && $toolbar_set != 'Default') { - foreach ($value as $toolbar_name => $toolbar_data) { - if ($toolbar_set == $toolbar_name) { - if (!isset($this->Config[$key][$toolbar_name])) { - $this->Config[$key] = (boolean) $toolbar_data; + if (is_array($value)) { + foreach ($value as $toolbar_name => $toolbar_data) { + if ($toolbar_set == $toolbar_name) { + if (!isset($this->Config[$key][$toolbar_name])) { + $this->Config[$key] = (boolean) $toolbar_data; + } + break; } - break; } } } break; case 'ToolbarLocation': if (!empty($toolbar_set) && $toolbar_set != 'Default') { - foreach ($value as $toolbar_name => $toolbar_data) { - if ($toolbar_set == $toolbar_name) { - if (!isset($this->Config[$key][$toolbar_name])) { - $this->Config[$key] = (string) $toolbar_data; + if (is_array($value)) { + foreach ($value as $toolbar_name => $toolbar_data) { + if ($toolbar_set == $toolbar_name) { + if (!isset($this->Config[$key][$toolbar_name])) { + $this->Config[$key] = (string) $toolbar_data; + } + break; } - break; } } }