- enhancement the default plugin handler can now also resolve undefined modifier (Smarty::PLUGIN_MODIFIER)

(Issue 85)
This commit is contained in:
uwe.tews@googlemail.com
2012-03-02 20:26:38 +00:00
parent 902e8e6e15
commit f6769036f1
2 changed files with 10 additions and 0 deletions

View File

@@ -1,4 +1,8 @@
===== trunk =====
02.03.2012
- enhancement the default plugin handler can now also resolve undefined modifier (Smarty::PLUGIN_MODIFIER)
(Issue 85)
===== Smarty-3.1.8 =====
19.02.2012
- bugfix {include} could result in a fatal error if used in appended or prepended nested {block} tags

View File

@@ -69,6 +69,12 @@ class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBa
if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedPhpModifier($modifier, $compiler)) {
$output = "{$modifier}({$params})";
}
} else if (is_callable($compiler->smarty->default_plugin_handler_func) && $compiler->getPluginFromDefaultHandler($modifier, Smarty::PLUGIN_MODIFIER) && isset($compiler->default_handler_plugins[Smarty::PLUGIN_MODIFIER][$modifier])) {
$function = $compiler->default_handler_plugins[Smarty::PLUGIN_MODIFIER][$modifier][0];
// check if modifier allowed
if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)) {
$output = "{$function}({$params})";
}
} else {
$compiler->trigger_template_error("unknown modifier \"" . $modifier . "\"", $compiler->lex->taglineno);
}