blob: 98f6dc735c101657cfc3b0337592d3922554393a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
<?php
function build_post_subject($listtag, $forumtag, $subject) {
// strip the '[list]' and '[forum]' tags
$tagpat = '/(' . preg_quote($listtag, '/') .
'|' . 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)) {
$subj = substr($subj, strlen($m[0]));
}
// ensure nonempty subject
$subj = trim($subj);
if ($subj == '') {
$subj = '(no subject)';
}
return $subj;
}
?>
|