From: x2003bruneau Date: Sat, 8 Jul 2006 15:56:14 +0000 (+0000) Subject: Automatically add fup if newsgroups contains multiple destinations X-Git-Tag: 1.8~238 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=6551668a715a2eb6b0e5867867028b8e91c62463;p=banana.git Automatically add fup if newsgroups contains multiple destinations git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@57 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- diff --git a/Changelog b/Changelog index 91120db..79f5e0b 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,7 @@ +Sat, 08 Jul 2006 Florent Bruneau + + * Automatically set fup for crossposts + ================================================================================ VERSION 1.3 diff --git a/banana/banana.inc.php.in b/banana/banana.inc.php.in index acf9317..7ff9f5e 100644 --- a/banana/banana.inc.php.in +++ b/banana/banana.inc.php.in @@ -355,17 +355,25 @@ class Banana } } - $to = preg_replace('/\s*(,|;)\s*/', ',', $_POST['newsgroups']); + $forums = preg_split('/\s*(,|;)\s*/', $_POST['newsgroups']); + $fup = $_POST['followup']; + if (sizeof($forums) > 1) { + if (empty($fup)) { + $fup = $forums[0]; + } + } + $to = implode(',', $forums); + if (!$this->_newSpool($group, $this->profile['display'], $this->profile['lastnews'])) { return '

'._b_('Impossible charger la liste des messages').'

'; } $body = preg_replace("/\n\.[ \t\r]*\n/m", "\n..\n", $_POST['body']); - $msg = 'From: '.$this->profile['name']."\n" + $msg = 'From: ' . $this->profile['name'] . "\n" . "Newsgroups: ". $to . "\n" - . "Subject: ".headerEncode($_POST['subject'], 128)."\n" + . "Subject: " . headerEncode($_POST['subject'], 128) . "\n" . (empty($this->profile['org']) ? '' : "Organization: {$this->profile['org']}\n") - . (empty($_POST['followup']) ? '' : 'Followup-To: '.$_POST['followup']."\n"); + . (empty($fup) ? '' : 'Followup-To: ' . $fup . "\n"); if ($artid != -1) { $this->_require('post');