- bugfix the default plugin handler did not allow static class methods for modifier (issue 85)

This commit is contained in:
uwe.tews@googlemail.com
2012-06-25 21:46:17 +00:00
parent fc8e4767ca
commit d59870d557
2 changed files with 12 additions and 1 deletions

View File

@@ -1,4 +1,7 @@
===== trunk ===== ===== trunk =====
25.06.2012
- bugfix the default plugin handler did not allow static class methods for modifier (issue 85)
24.06.2012 24.06.2012
- bugfix escape modifier support for PHP < 5.2.3 (Forum Topic 21176) - bugfix escape modifier support for PHP < 5.2.3 (Forum Topic 21176)

View File

@@ -108,7 +108,15 @@ class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBa
$function = $compiler->default_handler_plugins[Smarty::PLUGIN_MODIFIER][$modifier][0]; $function = $compiler->default_handler_plugins[Smarty::PLUGIN_MODIFIER][$modifier][0];
// check if modifier allowed // check if modifier allowed
if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)) { if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)) {
if (!is_array($function)) {
$output = "{$function}({$params})"; $output = "{$function}({$params})";
} else {
if (is_object($function[0])) {
$output = '$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][\'' . $modifier . '\'][0][0]->' . $function[1] . '(' . $params . ')';
} else {
$output = $function[0] . '::' . $function[1] . '(' . $params . ')';
}
}
} }
if (isset($compiler->template->required_plugins['nocache'][$modifier][Smarty::PLUGIN_MODIFIER]['file']) || isset($compiler->template->required_plugins['compiled'][$modifier][Smarty::PLUGIN_MODIFIER]['file'])) { if (isset($compiler->template->required_plugins['nocache'][$modifier][Smarty::PLUGIN_MODIFIER]['file']) || isset($compiler->template->required_plugins['compiled'][$modifier][Smarty::PLUGIN_MODIFIER]['file'])) {
// was a plugin // was a plugin