diff --git a/Smarty_Compiler.class.php b/Smarty_Compiler.class.php index fc6809f0..5a77555c 100644 --- a/Smarty_Compiler.class.php +++ b/Smarty_Compiler.class.php @@ -1093,7 +1093,7 @@ class Smarty_Compiler extends Smarty { foreach($match[0] as $var) { $var_expr = str_replace ($var, '".' . $this->_parse_var($var) . '."', $var_expr); } - $tokens[$expr_index] = preg_replace(array('!^""\.!','!\.""\.!'), array('','.'), $var_expr); + $tokens[$expr_index] = preg_replace(array('!(^""\.)|(\.""$)!','!\.""\.!'), array('','.'), $var_expr); } } } diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index fc6809f0..5a77555c 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -1093,7 +1093,7 @@ class Smarty_Compiler extends Smarty { foreach($match[0] as $var) { $var_expr = str_replace ($var, '".' . $this->_parse_var($var) . '."', $var_expr); } - $tokens[$expr_index] = preg_replace(array('!^""\.!','!\.""\.!'), array('','.'), $var_expr); + $tokens[$expr_index] = preg_replace(array('!(^""\.)|(\.""$)!','!\.""\.!'), array('','.'), $var_expr); } } }