cvs: smarty /libs/plugins modifier.regex_replace.php
[email protected] ("Monte Ohrt") Wed, 08 Mar 2006 14:13:08 -0000
| Newsgroups | php.smarty.cvs |
|---|---|
| Message-ID | <cvsmohrt1141827188@cvsserver> |
mohrt Wed Mar 8 14:13:08 2006 UTC
Modified files:
/smarty/libs/plugins modifier.regex_replace.php
Log:
fix delimiter issue
http://cvs.php.net/viewcvs.cgi/smarty/libs/plugins/modifier.regex_replace.php?r1=1.6&r2=1.7&diff_format=u
Index: smarty/libs/plugins/modifier.regex_replace.php
diff -u smarty/libs/plugins/modifier.regex_replace.php:1.6 smarty/libs/plugins/modifier.regex_replace.php:1.7
--- smarty/libs/plugins/modifier.regex_replace.php:1.6 Fri Mar 3 14:46:33 2006
+++ smarty/libs/plugins/modifier.regex_replace.php Wed Mar 8 14:13:08 2006
@@ -22,7 +22,8 @@
*/
function smarty_modifier_regex_replace($string, $search, $replace)
{
- if (preg_match('!\W([\w\s]+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) {
+ $_delimq = preg_quote($string[0]);
+ if (preg_match('!' . $_delimq . '([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) {
/* remove eval-modifier from $search */
$search = substr($search, 0, -strlen($match[1])) . preg_replace('![e\s]+!', '', $match[1]);
}