From bf3f34cab11ba2c397b3a80571cca70fe71b807c Mon Sep 17 00:00:00 2001 From: messju Date: Thu, 3 Aug 2006 20:03:20 +0000 Subject: [PATCH] fix false replacement of "$t" inside double quotes thanks to checat for reporting this --- NEWS | 1 + libs/Smarty_Compiler.class.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 4cc0c501..90728c01 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +- fix false replacement of "$t" inside double quotes (checat, messju) - added support for column headings and caption element to html_table and updated the output to use thead/tbody elements (boots) - fixed ordering of replacements in trimwhitespace output filter (Getty, boots) diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 367a8827..67a03f4c 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -1671,11 +1671,11 @@ class Smarty_Compiler extends Smarty { // if contains unescaped $, expand it if(preg_match_all('~(?:\`(?_dvar_guts_regexp . '(?:' . $this->_obj_ext_regexp . ')*\`)|(?:(?_parse_var(str_replace('`','',$_var)) . ')."', $var_expr); + $_replace[$_var] = '".(' . $this->_parse_var(str_replace('`','',$_var)) . ')."'; } + $var_expr = strtr($var_expr, $_replace); $_return = preg_replace('~\.""|(?