diff --git a/change_log.txt b/change_log.txt index 156c3172..f4c93bc8 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,8 @@ ===== trunk ===== +19.07.2012 +- bugfix the default plugin handler did create wrong compiled code for static class methods + from external script files (issue 108) + ===== Smarty-3.1.11 ===== 30.06.2012 - bugfix {block.. hide} did not work as nested child (Forum Topic 22216) diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index de9d54cf..29017edb 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -344,7 +344,11 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { foreach ($this->required_plugins['compiled'] as $tmp) { foreach ($tmp as $data) { $file = addslashes($data['file']); - $plugins_string .= "if (!is_callable('{$data['function']}')) include '{$file}';\n"; + if (is_Array($data['function'])){ + $plugins_string .= "if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) include '{$file}';\n"; + } else { + $plugins_string .= "if (!is_callable('{$data['function']}')) include '{$file}';\n"; + } } } $plugins_string .= '?>'; @@ -355,7 +359,11 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { foreach ($this->required_plugins['nocache'] as $tmp) { foreach ($tmp as $data) { $file = addslashes($data['file']); - $plugins_string .= addslashes("if (!is_callable('{$data['function']}')) include '{$file}';\n"); + if (is_Array($data['function'])){ + $plugins_string .= addslashes("if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) include '{$file}';\n"); + } else { + $plugins_string .= addslashes("if (!is_callable('{$data['function']}')) include '{$file}';\n"); + } } } $plugins_string .= "?>/*/%%SmartyNocache:{$this->properties['nocache_hash']}%%*/';?>\n";