diff options
Diffstat (limited to 'src/build_post.php')
-rw-r--r-- | src/build_post.php | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/build_post.php b/src/build_post.php index 2685d69..832fa7a 100644 --- a/src/build_post.php +++ b/src/build_post.php @@ -8,23 +8,20 @@ function build_post_subject($listtag, $forumtag, $subject) { // strip the '[list]' and '[forum]' tags $tagpat = '/(' . preg_quote($listtag, '/') . '|' . preg_quote($forumtag, '/') . ')\\s*/'; - $subject = preg_replace($tagpat, '', $subject); + $subj = preg_replace($tagpat, '', $subject); // strip leading sequences of Re-equivalents - if (preg_match( - '/^((RE|AW|SV|VS)(\\[\\d+\\])?:\\s*)+/i', - $subject, $m, PREG_OFFSET_CAPTURE - )) { - $subject = substr($subject, $m[0][1]); + if (preg_match('/^(?:(?:RE|AW|SV|VS)(?:\\[\\d+\\])?:\\s*)+/i', $subj, $m)) { + $subj = substr($subj, strlen($m[0])); } // ensure nonempty subject - $subject = trim($subject); - if ($subject == '') { - $subject = '(no subject)'; + $subj = trim($subj); + if ($subj == '') { + $subj = '(no subject)'; } - return $subject; + return $subj; } ?> |