com web/bugs: Get rid of preg /e: include/functions.php
| From: | Rasmus Lerdorf | Date: | Sat, 21 Jul 2018 10:42:14 +0000 |
| Subject: | com web/bugs: Get rid of preg /e: include/functions.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-27152@lists.php.net to get a copy of this message | ||
Commit: c75a11c6847b3f3e970c163fb0c5c69c2075ca07
Author: Rasmus Lerdorf <rasmus@php.net> Sat, 21 Jul 2018 06:42:14 -0400
Parents: c442dc96f30c419107379e4f63e94d8122fc857d
Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=c75a11c6847b3f3e970c163fb0c5c69c2075ca07
Log:
Get rid of preg /e
Changed paths:
M include/functions.php
Diff:
diff --git a/include/functions.php b/include/functions.php
index 1521db8..03ab96b 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -994,12 +994,15 @@ function mail_bug_updates($bug, $in, $from, $ncomment, $edit = 1, $id = false)
}
if ($ncomment) {
- $ncomment = preg_replace('#<div
class="changeset">(.*)</div>#sUe',
"ltrim(strip_tags('\\1'))", $ncomment);
+# $ncomment = preg_replace('#<div
class="changeset">(.*)</div>#sUe',
"ltrim(strip_tags('\\1'))", $ncomment);
+ $ncomment = preg_replace_callback('#<div
class="changeset">(.*)</div>#sU', function ($m) { return
ltrim(strip_tags($m[0])); }, $ncomment);
+
$text[] = " New Comment:\n\n{$ncomment}";
}
$old_comments = get_old_comments($bug['id'], empty($ncomment));
- $old_comments = preg_replace('#<div
class="changeset">(.*)</div>#sUe',
"ltrim(strip_tags('\\1'))", $old_comments);
+# $old_comments = preg_replace('#<div
class="changeset">(.*)</div>#sUe',
"ltrim(strip_tags('\\1'))", $old_comments);
+ $old_comments = preg_replace_callback('#<div
class="changeset">(..*)</div>#sU', function ($m) { return
ltrim(strip_tags($m[0])); }, $old_comments);
$text[] = $old_comments;