mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
fix false replacement of "$t" inside double quotes
thanks to checat for reporting this
This commit is contained in:
1
NEWS
1
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)
|
||||
|
@@ -1671,11 +1671,11 @@ class Smarty_Compiler extends Smarty {
|
||||
// if contains unescaped $, expand it
|
||||
if(preg_match_all('~(?:\`(?<!\\\\)\$' . $this->_dvar_guts_regexp . '(?:' . $this->_obj_ext_regexp . ')*\`)|(?:(?<!\\\\)\$\w+(\[[a-zA-Z0-9]+\])*)~', $var_expr, $_match)) {
|
||||
$_match = $_match[0];
|
||||
rsort($_match);
|
||||
reset($_match);
|
||||
$_replace = array();
|
||||
foreach($_match as $_var) {
|
||||
$var_expr = str_replace ($_var, '".(' . $this->_parse_var(str_replace('`','',$_var)) . ')."', $var_expr);
|
||||
$_replace[$_var] = '".(' . $this->_parse_var(str_replace('`','',$_var)) . ')."';
|
||||
}
|
||||
$var_expr = strtr($var_expr, $_replace);
|
||||
$_return = preg_replace('~\.""|(?<!\\\\)""\.~', '', $var_expr);
|
||||
} else {
|
||||
$_return = $var_expr;
|
||||
|
Reference in New Issue
Block a user