From cbaa09ea3d668a8d58da20d5b3e672eb476a5730 Mon Sep 17 00:00:00 2001 From: ovclas Date: Thu, 13 Oct 2011 07:26:30 +0000 Subject: [PATCH] issue 462 when recreate cache file, show foreach warning this bug fixed git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9635 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/module/module.admin.model.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/module/module.admin.model.php b/modules/module/module.admin.model.php index 783584d9a..24c0f9b00 100644 --- a/modules/module/module.admin.model.php +++ b/modules/module/module.admin.model.php @@ -177,16 +177,20 @@ $selected_lang = array(); $rand_name = $tmp[Context::getLangType()]; if(!$rand_name) $rand_name = array_shift($tmp); - foreach($lang_supported as $key => $val) { - $selected_lang[$key] = $tmp[$key]?$tmp[$key]:$rand_name; - } + if(is_array($lang_supported)) + { + foreach($lang_supported as $key => $val) + $selected_lang[$key] = $tmp[$key]?$tmp[$key]:$rand_name; + } } } $output = array(); - foreach($lang_supported as $key => $val) { - $output[$key] = $selected_lang[$key]?$selected_lang[$key]:$name; - } + if(is_array($lang_supported)) + { + foreach($lang_supported as $key => $val) + $output[$key] = $selected_lang[$key]?$selected_lang[$key]:$name; + } return $output; }