summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Uckelman <uckelman@nomic.net>2012-02-27 07:12:05 +0100
committerJoel Uckelman <uckelman@nomic.net>2012-02-27 07:12:05 +0100
commit6a1a634202995b9d409ed10eadb4b5d8c21c8c00 (patch)
treec43c227f45ef4ff258dca962829282fa8e003330
parent712632be01e1ef05bd474b8b8a7952f651b3476c (diff)
phpBB 3.0 adds 'Re:' to reply subjects, so we have to strip it on the way out to the list.
-rw-r--r--src/build_email.php9
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)';