mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-07 03:44:26 +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
|
- added support for column headings and caption element to html_table and
|
||||||
updated the output to use thead/tbody elements (boots)
|
updated the output to use thead/tbody elements (boots)
|
||||||
- fixed ordering of replacements in trimwhitespace output filter (Getty, 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 contains unescaped $, expand it
|
||||||
if(preg_match_all('~(?:\`(?<!\\\\)\$' . $this->_dvar_guts_regexp . '(?:' . $this->_obj_ext_regexp . ')*\`)|(?:(?<!\\\\)\$\w+(\[[a-zA-Z0-9]+\])*)~', $var_expr, $_match)) {
|
if(preg_match_all('~(?:\`(?<!\\\\)\$' . $this->_dvar_guts_regexp . '(?:' . $this->_obj_ext_regexp . ')*\`)|(?:(?<!\\\\)\$\w+(\[[a-zA-Z0-9]+\])*)~', $var_expr, $_match)) {
|
||||||
$_match = $_match[0];
|
$_match = $_match[0];
|
||||||
rsort($_match);
|
$_replace = array();
|
||||||
reset($_match);
|
|
||||||
foreach($_match as $_var) {
|
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);
|
$_return = preg_replace('~\.""|(?<!\\\\)""\.~', '', $var_expr);
|
||||||
} else {
|
} else {
|
||||||
$_return = $var_expr;
|
$_return = $var_expr;
|
||||||
|
Reference in New Issue
Block a user