php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #51543
Patch bug51543 revision 2010-10-29 11:18 UTC by kalle@php.net

Patch bug51543 for Website problem Bug #51543

Patch version 2010-10-29 11:18 UTC

Return to Bug #51543 | Download this patch
Patch Revisions:

Developer: kalle@php.net

Index: common.inc
===================================================================
--- common.inc	(revision 304936)
+++ common.inc	(working copy)
@@ -134,7 +134,13 @@
 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) . "...";
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 18:01:35 2024 UTC