diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index b8a7c209..0bb2b3a6 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -289,14 +289,14 @@ class Smarty extends Smarty_Internal_TemplateBase * * @var string */ - public $joined_template_dir = ''; + public $_joined_template_dir = null; /** * joined config directory string used in cache keys * * @var string */ - public $joined_config_dir = ''; + public $_joined_config_dir = null; /** * default template handler @@ -908,7 +908,7 @@ class Smarty extends Smarty_Internal_TemplateBase public function setTemplateDir($template_dir, $isConfig = false) { $type = $isConfig ? 'config_dir' : 'template_dir'; - $joined = 'joined_' . $type; + $joined = '_joined_' . $type; $this->{$type} = (array) $template_dir; $this->{$joined} = join(' # ', $this->{$type}); $this->_cache[$type . '_new'] = true; @@ -928,7 +928,7 @@ class Smarty extends Smarty_Internal_TemplateBase public function addTemplateDir($template_dir, $key = null, $isConfig = false) { $type = $isConfig ? 'config_dir' : 'template_dir'; - $joined = 'joined_' . $type; + $joined = '_joined_' . $type; if (!isset($this->_cache[$type])) { $this->{$type} = (array) $this->{$type}; $this->{$joined} = join(' # ', $this->{$type}); @@ -952,7 +952,7 @@ class Smarty extends Smarty_Internal_TemplateBase { $type = $isConfig ? 'config_dir' : 'template_dir'; if (!isset($this->_cache[$type])) { - $joined = 'joined_' . $type; + $joined = '_joined_' . $type; $this->{$type} = (array) $this->{$type}; $this->{$joined} = join(' # ', $this->{$type}); $this->_cache[$type] = false; diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index fd1ffd40..47de4a7a 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -444,7 +444,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase if ($this->smarty->allow_ambiguous_resources) { $_templateId = Smarty_Resource::getUniqueTemplateName($this, $template_name) . "#{$cache_id}#{$compile_id}"; } else { - $_templateId = $this->smarty->joined_template_dir . "#{$template_name}#{$cache_id}#{$compile_id}"; + $_templateId = $this->smarty->_joined_template_dir . "#{$template_name}#{$cache_id}#{$compile_id}"; } if (isset($_templateId[150])) { $_templateId = sha1($_templateId); diff --git a/libs/sysplugins/smarty_resource.php b/libs/sysplugins/smarty_resource.php index 39a45329..f11bb678 100644 --- a/libs/sysplugins/smarty_resource.php +++ b/libs/sysplugins/smarty_resource.php @@ -103,9 +103,15 @@ abstract class Smarty_Resource public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false) { if ($isConfig) { - return get_class($this) . '#' . $smarty->joined_config_dir . '#' . $resource_name; + if (!isset($smarty->_joined_config_dir)) { + $smarty->getTemplateDir(null, true); + } + return get_class($this) . '#' . $smarty->_joined_config_dir . '#' . $resource_name; } else { - return get_class($this) . '#' . $smarty->joined_template_dir . '#' . $resource_name; + if (!isset($smarty->_joined_template_dir)) { + $smarty->getTemplateDir(); + } + return get_class($this) . '#' . $smarty->_joined_template_dir . '#' . $resource_name; } }