diff options
author | Joel Uckelman <uckelman@nomic.net> | 2012-02-27 07:12:05 +0100 |
---|---|---|
committer | Joel Uckelman <uckelman@nomic.net> | 2012-02-27 07:12:05 +0100 |
commit | 6a1a634202995b9d409ed10eadb4b5d8c21c8c00 (patch) | |
tree | c43c227f45ef4ff258dca962829282fa8e003330 /src/build_email.php | |
parent | 712632be01e1ef05bd474b8b8a7952f651b3476c (diff) |
phpBB 3.0 adds 'Re:' to reply subjects, so we have to strip it on the way out to the list.
Diffstat (limited to 'src/build_email.php')
-rw-r--r-- | src/build_email.php | 9 |
1 files changed, 9 insertions, 0 deletions
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)'; |