- bugfix added exception if the default plugin handler did return a not static callback (Forum Topic 20512)

This commit is contained in:
uwe.tews@googlemail.com
2011-11-29 17:47:37 +00:00
parent fe68b976e8
commit f14c4bfb9c
2 changed files with 8 additions and 2 deletions

View File

@@ -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)

View File

@@ -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;