com web/news: Fixed bug #51543 (newsweb: bug summary/subject string issue): common.php
| From: | Kalle Sommer Nielsen | Date: | Sat, 27 Dec 2014 17:16:37 +0000 |
| Subject: | com web/news: Fixed bug #51543 (newsweb: bug summary/subject string issue): common.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-20392@lists.php.net to get a copy of this message | ||
Commit: 5e9dff7a2e603bd94402d535b60658a5fcdb1ac7
Author: Kalle Sommer Nielsen <kalle@php.net> Sat, 27 Dec 2014 18:16:37 +0100
Parents: 38c15ff1d6ee0b1d494bd510ef3844e75a945ac6
Branches: master
Link: http://git.php.net/?p=web/news.git;a=commitdiff;h=5e9dff7a2e603bd94402d535b60658a5fcdb1ac7
Log:
Fixed bug #51543 (newsweb: bug summary/subject string issue)
Bugs:
https://bugs.php.net/51543
Changed paths:
M common.php
Diff:
diff --git a/common.php b/common.php
index a3ab38c..78a7245 100644
--- a/common.php
+++ b/common.php
@@ -125,7 +125,13 @@ function format_author($a, $charset) {
function format_subject($s, $charset) {
global $article;
$s = recode_header($s, $charset);
- $s = preg_replace("/^(Re: *)?\[(PHP|PEAR)(-..*)?\] /i", "\\1", $s);
+
+ if ((($pos = strpos($s, '[PHP')) !== false || ($pos = strpos($s, '[PEAR')) !==
false)) {
+ if (($end_pos = strpos($s, ']', $pos)) !== false) {
+ $s = ltrim(substr_replace($s, '', $pos, $end_pos - $pos + 1));
+ }
+ }
+
// make this look better on the preview page..
if (strlen($s) > 150 && !isset($article)) {
$s = substr($s, 0, 150) . "...";