fixed config_load to only load defaults with no section defined

This commit is contained in:
monte.ohrt
2011-03-08 16:14:38 +00:00
parent 9d1b0abe5c
commit 3e0c5e06b1
2 changed files with 14 additions and 10 deletions

View File

@@ -1,4 +1,6 @@
===== SVN trunk ===== ===== SVN trunk =====
08/03/2011
- bugfix loading config file without section should load only defaults
03/03/2011 03/03/2011
- bugfix "smarty" template variable was not recreated when cached templated had expired - bugfix "smarty" template variable was not recreated when cached templated had expired
- bugfix internal rendered_content must be cleared after subtemplate was included - bugfix internal rendered_content must be cleared after subtemplate was included

View File

@@ -272,16 +272,18 @@ class Smarty_Internal_Config {
} }
} }
// scan sections // scan sections
foreach ($_config_vars['sections'] as $this_section => $dummy) { if(!empty($sections)) {
if ($sections == null || in_array($this_section, (array)$sections)) { foreach ($_config_vars['sections'] as $this_section => $dummy) {
foreach ($_config_vars['sections'][$this_section]['vars'] as $variable => $value) { if (in_array($this_section, (array)$sections)) {
if ($this->smarty->config_overwrite || !isset($scope_ptr->config_vars[$variable])) { foreach ($_config_vars['sections'][$this_section]['vars'] as $variable => $value) {
$scope_ptr->config_vars[$variable] = $value; if ($this->smarty->config_overwrite || !isset($scope_ptr->config_vars[$variable])) {
} else { $scope_ptr->config_vars[$variable] = $value;
$scope_ptr->config_vars[$variable] = array_merge((array)$scope_ptr->config_vars[$variable], (array)$value); } else {
} $scope_ptr->config_vars[$variable] = array_merge((array)$scope_ptr->config_vars[$variable], (array)$value);
} }
} }
}
}
} }
} }
} }