- bugfix for Smarty2 style compiler plugins on unnamed attribute passing like {tag $foo $bar}

- bugfix debug.tpl did not display correctly when it was compiled with escape_html = true
This commit is contained in:
uwe.tews@googlemail.com
2011-09-18 18:36:26 +00:00
parent c86131979e
commit 8e6626fbca
3 changed files with 15 additions and 5 deletions
@@ -258,8 +258,12 @@ abstract class Smarty_Internal_TemplateCompilerBase {
// if compiler function plugin call it now
if ($plugin_type == Smarty::PLUGIN_COMPILER) {
$new_args = array();
foreach ($args as $mixed) {
$new_args = array_merge($new_args, $mixed);
foreach ($args as $key => $mixed) {
if (is_array($mixed)) {
$new_args = array_merge($new_args, $mixed);
} else {
$new_args[$key] = $mixed;
}
}
if (!$this->smarty->registered_plugins[$plugin_type][$tag][1]) {
$this->tag_nocache = true;
@@ -287,8 +291,12 @@ abstract class Smarty_Internal_TemplateCompilerBase {
if (is_callable($plugin)) {
// convert arguments format for old compiler plugins
$new_args = array();
foreach ($args as $mixed) {
$new_args = array_merge($new_args, $mixed);
foreach ($args as $key => $mixed) {
if (is_array($mixed)) {
$new_args = array_merge($new_args, $mixed);
} else {
$new_args[$key] = $mixed;
}
}
return $plugin($new_args, $this->smarty);
}