Commit: c75a11c6847b3f3e970c163fb0c5c69c2075ca07 Author: Rasmus Lerdorf <[email protected]> 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; -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
