- bugfix escaping " when block tags are used within doublequoted strings

This commit is contained in:
Uwe.Tews
2010-06-25 18:41:30 +00:00
parent ccc0e1b6c8
commit 6456403706
2 changed files with 8 additions and 4 deletions

View File

@@ -1,3 +1,6 @@
25/06/2010
- bugfix escaping " when block tags are used within doublequoted strings
24/06/2010 24/06/2010
- replace internal get_time() calls with standard PHP5 microtime(true) calls in Smarty_Internal_Utility - 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 - added $smarty->register->templateClass() and $smarty->unregister->templateClass() methods for supporting static classes with namespace

View File

@@ -6,7 +6,8 @@ abstract class _smarty_parsetree {
/* A complete smarty tag. */ /* A complete smarty tag. */
class _smarty_tag extends _smarty_parsetree { class _smarty_tag extends _smarty_parsetree
{
public $parser; public $parser;
public $data; public $data;
public $saved_block_nesting; 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 ($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) { if ($subtree instanceof _smarty_code) {
$this->subtrees[$last_subtree]->data .= '<?php echo ' . $subtree->data . ';?>'; $this->subtrees[$last_subtree]->data .= '<?php echo ' . $subtree->data . ';?>';
} elseif ($subtree instanceof _smarty_dq_content) {
$this->subtrees[$last_subtree]->data .= '<?php echo "' . $subtree->data . '";?>';
} else { } else {
$this->subtrees[$last_subtree]->data .= $subtree->data; $this->subtrees[$last_subtree]->data .= $subtree->data;
} }
@@ -96,8 +99,7 @@ class _smarty_doublequoted extends _smarty_parsetree {
$this->parser->compiler->has_variable_string = true; $this->parser->compiler->has_variable_string = true;
} }
} }
// $code = sprintf("(%s)", $code);
// $code = sprintf("(%s)", $code);
return $code; return $code;
} }
} }
@@ -117,5 +119,4 @@ class _smarty_dq_content extends _smarty_parsetree {
} }
} }
?> ?>