diff --git a/change_log.txt b/change_log.txt index 84b2ff78..d0691328 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +29.09.2011 +- improvement of Smarty_Internal_Config::loadConfigVars() dropped the in_array for index look up + 28.09.2011 - bugfix on template functions called nocache calling other template functions diff --git a/libs/sysplugins/smarty_internal_config.php b/libs/sysplugins/smarty_internal_config.php index 3a38e212..a309ec9f 100644 --- a/libs/sysplugins/smarty_internal_config.php +++ b/libs/sysplugins/smarty_internal_config.php @@ -240,8 +240,9 @@ class Smarty_Internal_Config { } // scan sections if (!empty($sections)) { + $sections = array_flip((array) $sections); foreach ($_config_vars['sections'] as $this_section => $dummy) { - if (in_array($this_section, (array) $sections)) { + if (isset($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;