From 64564037065386c7c4fa4c0b72d7c0807cc6bd65 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews" Date: Fri, 25 Jun 2010 18:41:30 +0000 Subject: [PATCH] - bugfix escaping " when block tags are used within doublequoted strings --- change_log.txt | 3 +++ libs/sysplugins/smarty_internal_parsetree.php | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/change_log.txt b/change_log.txt index 1d6d5350..06be758b 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,6 @@ +25/06/2010 +- bugfix escaping " when block tags are used within doublequoted strings + 24/06/2010 - replace internal get_time() calls with standard PHP5 microtime(true) calls in Smarty_Internal_Utility - added $smarty->register->templateClass() and $smarty->unregister->templateClass() methods for supporting static classes with namespace diff --git a/libs/sysplugins/smarty_internal_parsetree.php b/libs/sysplugins/smarty_internal_parsetree.php index bba83dba..605fe56b 100644 --- a/libs/sysplugins/smarty_internal_parsetree.php +++ b/libs/sysplugins/smarty_internal_parsetree.php @@ -6,7 +6,8 @@ abstract class _smarty_parsetree { /* A complete smarty tag. */ -class _smarty_tag extends _smarty_parsetree { +class _smarty_tag extends _smarty_parsetree +{ public $parser; public $data; public $saved_block_nesting; @@ -66,6 +67,8 @@ class _smarty_doublequoted extends _smarty_parsetree { if ($last_subtree >= 0 && $this->subtrees[$last_subtree] instanceof _smarty_tag && $this->subtrees[$last_subtree]->saved_block_nesting < $this->parser->block_nesting_level) { if ($subtree instanceof _smarty_code) { $this->subtrees[$last_subtree]->data .= 'data . ';?>'; + } elseif ($subtree instanceof _smarty_dq_content) { + $this->subtrees[$last_subtree]->data .= 'data . '";?>'; } else { $this->subtrees[$last_subtree]->data .= $subtree->data; } @@ -96,8 +99,7 @@ class _smarty_doublequoted extends _smarty_parsetree { $this->parser->compiler->has_variable_string = true; } } - -// $code = sprintf("(%s)", $code); + // $code = sprintf("(%s)", $code); return $code; } } @@ -117,5 +119,4 @@ class _smarty_dq_content extends _smarty_parsetree { } } - ?> \ No newline at end of file