cvs: smarty /libs/plugins modifier.regex_replace.php

"Monte Ohrt" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsmohrt1111414194@cvsserver>
mohrt		Mon Mar 21 09:09:54 2005 EDT

  Modified files:              
    /smarty/libs/plugins	modifier.regex_replace.php 
  Log:
  remove e-modifier
  
  
http://cvs.php.net/diff.php/smarty/libs/plugins/modifier.regex_replace.php?r1=1.2&r2=1.3&ty=u
Index: smarty/libs/plugins/modifier.regex_replace.php
diff -u smarty/libs/plugins/modifier.regex_replace.php:1.2 smarty/libs/plugins/modifier.regex_replace.php:1.3
--- smarty/libs/plugins/modifier.regex_replace.php:1.2	Sun Apr 20 17:12:08 2003
+++ smarty/libs/plugins/modifier.regex_replace.php	Mon Mar 21 09:09:50 2005
@@ -21,6 +21,10 @@
  */
 function smarty_modifier_regex_replace($string, $search, $replace)
 {
+    if (preg_match('!\W(\w+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) {
+        /* remove eval-modifier from $search */
+        $search = substr($search, 0, -strlen($match[1])) . str_replace('e', '', $match[1]);
+    }
     return preg_replace($search, $replace, $string);
 }
 

-- 
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.