- bugfix allow function plugins with name ending with 'close' https://github.com/smarty-php/smarty/issues/52

This commit is contained in:
Uwe Tews
2015-06-27 22:18:08 +02:00
parent 1360be4eef
commit 9d937ffe68
3 changed files with 12 additions and 1 deletions
@@ -638,10 +638,20 @@ abstract class Smarty_Internal_TemplateCompilerBase
if (isset($this->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$base_tag]) || isset($this->default_handler_plugins[Smarty::PLUGIN_BLOCK][$base_tag])) {
return $this->callTagCompiler('private_registered_block', $args, $parameter, $tag);
}
// registered function tag ?
if (isset($this->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION][$tag])) {
return $this->callTagCompiler('private_registered_function', $args, $parameter, $tag);
}
// block plugin?
if ($function = $this->getPlugin($base_tag, Smarty::PLUGIN_BLOCK)) {
return $this->callTagCompiler('private_block_plugin', $args, $parameter, $tag, $function);
}
// function plugin?
if ($function = $this->getPlugin($tag, Smarty::PLUGIN_FUNCTION)) {
if (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this)) {
return $this->callTagCompiler('private_function_plugin', $args, $parameter, $tag, $function);
}
}
// registered compiler plugin ?
if (isset($this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag])) {
// if compiler function plugin call it now