From dccaba62ca3223810bba15755b902c88c14b460c Mon Sep 17 00:00:00 2001 From: mohrt Date: Fri, 13 Dec 2002 15:58:45 +0000 Subject: [PATCH] update embedded variable logic, get rid of ."" at end of output --- Smarty_Compiler.class.php | 2 +- libs/Smarty_Compiler.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); } } }