Accept multiple syntaxes for destination newsgroues :
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Sun, 4 Jun 2006 15:40:17 +0000 (15:40 +0000)
committerx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Sun, 4 Jun 2006 15:40:17 +0000 (15:40 +0000)
newsgroup1/SEPARATOR/newsgroup2/SEPARATOR/...

where /SEPARATOR/ is like (spaces)(, or ;)(spaces)

git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@52 9869982d-c50d-0410-be91-f2a2ec7c7c7b

banana/banana.inc.php.in

index 4e5a875..0ca84e0 100644 (file)
@@ -341,11 +341,12 @@ class Banana
                 $_POST[$key] = utf8_encode($_POST[$key]);
             }
         }
-        
+       
+               $to   = preg_replace('/\s*(,|;)\s*/', ',', $_POST['newsgroups']);
         $this->_newSpool($group, $this->profile['display'], $this->profile['lastnews']);
         $body = preg_replace("/\n\.[ \t\r]*\n/m", "\n..\n", $_POST['body']);
         $msg  = 'From: '.$this->profile['name']."\n"
-              . "Newsgroups: ".$_POST['newsgroups']."\n"
+              . "Newsgroups: ". $to . "\n"
               . "Subject: ".headerEncode($_POST['subject'], 128)."\n"
               . (empty($this->profile['org']) ? '' : "Organization: {$this->profile['org']}\n")
               . (empty($_POST['followup'])    ? '' : 'Followup-To: '.$_POST['followup']."\n");