diff options
author | Joel Uckelman <uckelman@nomic.net> | 2012-02-27 05:54:36 +0100 |
---|---|---|
committer | Joel Uckelman <uckelman@nomic.net> | 2012-02-27 05:54:36 +0100 |
commit | e66b736aa6c2e00643b9b061d7064c7991503390 (patch) | |
tree | f30b9e8b135b4785bc1b149046918668a9e67d03 /src | |
parent | 809671070efe8ff29c633e9be03d0d41a5cf6560 (diff) |
Remove Edit marker from incoming mail, add it to outgoing mail.
Diffstat (limited to 'src')
-rw-r--r-- | src/build_email.php | 15 | ||||
-rw-r--r-- | src/build_post.php | 5 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/build_email.php b/src/build_email.php index a5bb7bd..567da0d 100644 --- a/src/build_email.php +++ b/src/build_email.php @@ -97,7 +97,7 @@ function build_email_from($name, $email) { return sprintf('%s <%s>', $qname, $email); } -function build_email_subject($forumtag, $reply, $subject) { +function build_email_subject($forumtag, $subject, $reply, $edit) { $subject = trim($subject); if ($subject == '') { $subject = '(no subject)'; @@ -109,22 +109,21 @@ function build_email_subject($forumtag, $reply, $subject) { $subject = 'Re: ' . $subject; } + if ($edit) { + $subject = 'Edit: ' . $subject; + } + return utf8_quote_non_ascii($subject); } function build_email_headers( - $userName, $userEmail, $to, $sender, $subject, $edit, - $time, $messageId, $forumURL, $inReplyTo, $references) + $userName, $userEmail, $to, $sender, $subject, $time, + $messageId, $forumURL, $inReplyTo, $references) { $from = build_email_from($userName, $userEmail); $subject = utf8_quote_non_ascii($subject); $date = date(DATE_RFC2822, $time); - if ($edit) { - $edit_header = 'Edit: '; - $subject = $edit_header . $subject; - } - $headers = array( 'To' => $to, 'From' => $from, diff --git a/src/build_post.php b/src/build_post.php index 98f6dc7..aa0cbf6 100644 --- a/src/build_post.php +++ b/src/build_post.php @@ -6,8 +6,9 @@ function build_post_subject($listtag, $forumtag, $subject) { '|' . preg_quote($forumtag, '/') . ')\\s*/'; $subj = preg_replace($tagpat, '', $subject); - // strip leading sequences of Re-equivalents - if (preg_match('/^(?:(?:RE|AW|SV|VS)(?:\\[\\d+\\])?:\\s*)+/i', $subj, $m)) { + // strip leading sequences of Re-equivalents and Edit + $re = '/^(?:(?:RE|AW|SV|VS|EDIT)(?:\\[\\d+\\])?:\\s*)+/i'; + if (preg_match($re, $subj, $m)) { $subj = substr($subj, strlen($m[0])); } |