mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
- bugfix added exception if the default plugin handler did return a not static callback (Forum Topic 20512)
This commit is contained in:
@@ -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)
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user