From 6a1a634202995b9d409ed10eadb4b5d8c21c8c00 Mon Sep 17 00:00:00 2001 From: Joel Uckelman Date: Mon, 27 Feb 2012 07:12:05 +0100 Subject: phpBB 3.0 adds 'Re:' to reply subjects, so we have to strip it on the way out to the list. --- src/build_email.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/build_email.php') diff --git a/src/build_email.php b/src/build_email.php index 567da0d..f395b27 100644 --- a/src/build_email.php +++ b/src/build_email.php @@ -98,6 +98,15 @@ function build_email_from($name, $email) { } function build_email_subject($forumtag, $subject, $reply, $edit) { + if ($reply) { + // strip leading sequences of Re-equivalents + $re = '/^(?:(?:RE|AW|SV|VS)(?:\\[\\d+\\])?:\\s*)+/i'; + if (preg_match($re, $subject, $m)) { + $subject = substr($subject, strlen($m[0])); + } + } + + // ensure nonempty subject $subject = trim($subject); if ($subject == '') { $subject = '(no subject)'; -- cgit v1.2.3