cvs: smarty /libs/plugins modifier.regex_replace.php
[email protected] ("Monte Ohrt") Fri, 03 Mar 2006 14:46:34 -0000
| Newsgroups | php.smarty.cvs |
|---|---|
| Message-ID | <cvsmohrt1141397194@cvsserver> |
mohrt Fri Mar 3 14:46:34 2006 UTC
Modified files:
/smarty/libs/plugins modifier.regex_replace.php
Log:
use preg_replace to cover any space chars
http://cvs.php.net/viewcvs.cgi/smarty/libs/plugins/modifier.regex_replace.php?r1=1.5&r2=1.6&diff_format=u
Index: smarty/libs/plugins/modifier.regex_replace.php
diff -u smarty/libs/plugins/modifier.regex_replace.php:1.5 smarty/libs/plugins/modifier.regex_replace.php:1.6
--- smarty/libs/plugins/modifier.regex_replace.php:1.5 Fri Mar 3 14:42:01 2006
+++ smarty/libs/plugins/modifier.regex_replace.php Fri Mar 3 14:46:33 2006
@@ -24,9 +24,9 @@
{
if (preg_match('!\W([\w\s]+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) {
/* remove eval-modifier from $search */
- $search = substr($search, 0, -strlen($match[1])) . str_replace(array(' ','e'), array('',''), $match[1]);
+ $search = substr($search, 0, -strlen($match[1])) . preg_replace('![e\s]+!', '', $match[1]);
}
-
+
return preg_replace($search, $replace, $string);
}