From b069c08eb42a719b4ab14393445bed4f5791ade3 Mon Sep 17 00:00:00 2001 From: "uwe.tews@googlemail.com" Date: Wed, 1 Aug 2012 21:31:24 +0000 Subject: [PATCH] - bugfix avoid PHP error on $smarty->configLoad(...) with invalid section specification (Forum Topic 22608) --- change_log.txt | 3 +++ libs/sysplugins/smarty_internal_config.php | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/change_log.txt b/change_log.txt index 39653536..56188d6e 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +01.08.2012 +- bugfix avoid PHP error on $smarty->configLoad(...) with invalid section specification (Forum Topic 22608) + 30.07.2012 -bugfix {assign} in a nocache section should not overwrite existing variable values during compilation (issue 109) diff --git a/libs/sysplugins/smarty_internal_config.php b/libs/sysplugins/smarty_internal_config.php index a309ec9f..bcb3ce05 100644 --- a/libs/sysplugins/smarty_internal_config.php +++ b/libs/sysplugins/smarty_internal_config.php @@ -240,9 +240,8 @@ class Smarty_Internal_Config { } // scan sections if (!empty($sections)) { - $sections = array_flip((array) $sections); - foreach ($_config_vars['sections'] as $this_section => $dummy) { - if (isset($sections[$this_section])) { + foreach ((array) $sections as $this_section) { + if (isset($_config_vars['sections'][$this_section])) { foreach ($_config_vars['sections'][$this_section]['vars'] as $variable => $value) { if ($this->smarty->config_overwrite || !isset($scope_ptr->config_vars[$variable])) { $scope_ptr->config_vars[$variable] = $value;