cvs: smarty / NEWS /libs Smarty_Compiler.class.php

[email protected] ("Messju Mohr") Thu, 03 Aug 2006 20:03:20 -0000
Newsgroups php.smarty.cvs
Message-ID <cvsmessju1154635400@cvsserver>
messju		Thu Aug  3 20:03:20 2006 UTC

  Modified files:              
    /smarty	NEWS 
    /smarty/libs	Smarty_Compiler.class.php 
  Log:
  fix false replacement of "$t" inside double quotes
  thanks to checat for reporting this
  
  
  
http://cvs.php.net/viewvc.cgi/smarty/NEWS?r1=1.537&r2=1.538&diff_format=u
Index: smarty/NEWS
diff -u smarty/NEWS:1.537 smarty/NEWS:1.538
--- smarty/NEWS:1.537	Mon Jul 10 15:37:07 2006
+++ smarty/NEWS	Thu Aug  3 20:03:20 2006
@@ -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)
http://cvs.php.net/viewvc.cgi/smarty/libs/Smarty_Compiler.class.php?r1=1.382&r2=1.383&diff_format=u
Index: smarty/libs/Smarty_Compiler.class.php
diff -u smarty/libs/Smarty_Compiler.class.php:1.382 smarty/libs/Smarty_Compiler.class.php:1.383
--- smarty/libs/Smarty_Compiler.class.php:1.382	Sun May 28 17:35:05 2006
+++ smarty/libs/Smarty_Compiler.class.php	Thu Aug  3 20:03:20 2006
@@ -26,7 +26,7 @@
  * @package Smarty
  */
 
-/* $Id: Smarty_Compiler.class.php,v 1.382 2006/05/28 17:35:05 mohrt Exp $ */
+/* $Id: Smarty_Compiler.class.php,v 1.383 2006/08/03 20:03:20 messju Exp $ */
 
 /**
  * Template compiling class
@@ -1671,11 +1671,11 @@
         // 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;