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

"Messju Mohr" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsmessju1090951175@cvsserver>
messju		Tue Jul 27 13:59:35 2004 EDT

  Modified files:              
    /smarty	NEWS 
    /smarty/libs	Smarty_Compiler.class.php 
  Log:
  fixed handling of methods arguments.
  
  thanks to Manfred Wischin for finding this one and providing the
  conceptual fix.
  
  
  
http://cvs.php.net/diff.php/smarty/NEWS?r1=1.464&r2=1.465&ty=u
Index: smarty/NEWS
diff -u smarty/NEWS:1.464 smarty/NEWS:1.465
--- smarty/NEWS:1.464	Fri Jul 23 11:34:52 2004
+++ smarty/NEWS	Tue Jul 27 13:59:34 2004
@@ -1,3 +1,4 @@
+  - fix handling of methods arguments (messju, Manfred Wischin)
   - remove touch() call that made the compiled-template's timestamp the
     same as the source-template's one. (messju)
   - add assign attribute to html_checkboxes and html_radios
http://cvs.php.net/diff.php/smarty/libs/Smarty_Compiler.class.php?r1=1.328&r2=1.329&ty=u
Index: smarty/libs/Smarty_Compiler.class.php
diff -u smarty/libs/Smarty_Compiler.class.php:1.328 smarty/libs/Smarty_Compiler.class.php:1.329
--- smarty/libs/Smarty_Compiler.class.php:1.328	Fri Jul 23 11:34:52 2004
+++ smarty/libs/Smarty_Compiler.class.php	Tue Jul 27 13:59:35 2004
@@ -26,7 +26,7 @@
  * @package Smarty
  */
 
-/* $Id: Smarty_Compiler.class.php,v 1.328 2004/07/23 15:34:52 messju Exp $ */
+/* $Id: Smarty_Compiler.class.php,v 1.329 2004/07/27 17:59:35 messju Exp $ */
 
 /**
  * Template compiling class
@@ -1811,12 +1811,13 @@
     function _parse_parenth_args($parenth_args)
     {
         preg_match_all('!' . $this->_param_regexp . '!',$parenth_args, $match);
-        $match = $match[0];
-        rsort($match);
-        reset($match);
-        $orig_vals = $match;
+        $orig_vals = $match = $match[0];
         $this->_parse_vars_props($match);
-        return str_replace($orig_vals, $match, $parenth_args);
+        $replace = array();
+        for ($i = 0, $count = count($match); $i < $count; $i++) {
+            $replace[$orig_vals[$i]] = $match[$i];
+        }
+        return strtr($parenth_args, $replace);
     }
 
     /**

-- 
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.