diff --git a/change_log.txt b/change_log.txt index 0714689e..f43245f9 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +29.11.2011 +- bugfix added exception if the default plugin handler did return a not static callback (Forum Topic 20512) + 25.11.2011 - bugfix {html_select_date} and {html_slecet_time} did not default to current time if "time" was not specified since r4432 (issue 60) diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index 0f218384..1f50be75 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -521,14 +521,17 @@ abstract class Smarty_Internal_TemplateCompilerBase { } include_once $script; } else { - throw new SmartyCompilerException("Plugin or modifer script file $script not found"); + $this->trigger_template_error("Default plugin handler: Returned script file \"{$script}\" for \"{$tag}\" not found"); } } + if (!is_string($callback) && !(is_array($callback) && is_string($callback[0]) && is_string($callback[1]))) { + $this->trigger_template_error("Default plugin handler: Returned callback for \"{$tag}\" must be a static function name or array of class and function name"); + } if (is_callable($callback)) { $this->default_handler_plugins[$plugin_type][$tag] = array($callback, true, array()); return true; } else { - throw new SmartyCompilerException("Function for plugin or modifier $tag not callable"); + $this->trigger_template_error("Default plugin handler: Returned callback for \"{$tag}\" not callable"); } } return false;