summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruwe.tews@googlemail.com <uwe.tews@googlemail.com>2011-09-18 18:36:26 +0000
committeruwe.tews@googlemail.com <uwe.tews@googlemail.com>2011-09-18 18:36:26 +0000
commit8e6626fbca3d04898ba289cd521988e972899fa1 (patch)
tree2b145d7911de317f099eb376c572551c4249ab09
parentc86131979e018e17756b0c964c327b9552000a2f (diff)
downloadsmarty-8e6626fbca3d04898ba289cd521988e972899fa1.tar.gz
smarty-8e6626fbca3d04898ba289cd521988e972899fa1.tar.bz2
smarty-8e6626fbca3d04898ba289cd521988e972899fa1.zip
- 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
-rw-r--r--change_log.txt2
-rw-r--r--libs/debug.tpl2
-rw-r--r--libs/sysplugins/smarty_internal_templatecompilerbase.php16
3 files changed, 15 insertions, 5 deletions
diff --git a/change_log.txt b/change_log.txt
index c66927e6..3aa544ef 100644
--- a/change_log.txt
+++ b/change_log.txt
@@ -4,6 +4,8 @@
- bugfix {include $file} was broken when merge_compiled_incluges = true
- bugfix {include} was broken when merge_compiled_incluges = true and same indluded template
was used in different main templates in one compilation run
+- 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
17.09.2011
- bugfix lock_id for file resource would create invalid filepath
diff --git a/libs/debug.tpl b/libs/debug.tpl
index 058c5b20..5a780186 100644
--- a/libs/debug.tpl
+++ b/libs/debug.tpl
@@ -128,6 +128,6 @@ td {
<script type="text/javascript">
{$id = $template_name|default:''|md5}
_smarty_console = window.open("","console{$id}","width=680,height=600,resizable,scrollbars=yes");
- _smarty_console.document.write("{$debug_output|escape:'javascript'}");
+ _smarty_console.document.write("{$debug_output|escape:'javascript' nofilter}");
_smarty_console.document.close();
</script>
diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php
index 53948aba..15df9090 100644
--- a/libs/sysplugins/smarty_internal_templatecompilerbase.php
+++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php
@@ -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);
}