From: x2003bruneau Date: Sat, 23 Jun 2007 09:33:18 +0000 (+0000) Subject: Accept ";", "," and " " as newsgroup separators X-Git-Tag: 1.8~43 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=56b35f9c2b6945a893e01756931634969fc57460;hp=a3c90095a1920b1d39cb1e8ffd892ba407351ca6;p=banana.git Accept ";", "," and " " as newsgroup separators git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@267 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- diff --git a/Changelog b/Changelog index c2c85ff..b57ade2 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,7 @@ +Sat, 23 Jun 2007 Florent Bruneau + + * Bugfix: To/Newsgroups formatting + Tue, 12 Jun 2007 Florent Bruneau * PGP signature check diff --git a/banana/banana.inc.php.in b/banana/banana.inc.php.in index 386e4c1..2e5c633 100644 --- a/banana/banana.inc.php.in +++ b/banana/banana.inc.php.in @@ -504,10 +504,9 @@ class Banana if (!is_utf8($hdr_values[$header])) { $hdr_values[$header] = utf8_encode($hdr_values[$header]); } - if ($headers != 'Subject') { - $hdr_values[$header] = str_replace(', ', ',', $hdr_values[$header]); - } } + $values = split('[,; ]', $hdr_values[$hdrs['dest']]); + $hdr_values[$hdrs['dest']] = preg_replace('/,+/', ',', implode(',', $values)); if (!is_null($artid)) { $old =& $this->loadMessage($group, $artid); $hdr_values['References'] = $old->getHeaderValue('references') . ' ' . $old->getHeaderValue('message-id'); @@ -536,6 +535,7 @@ class Banana } else { Banana::$page->trig(_b_('Une erreur est survenue lors de l\'envoi du message :') . '
' . Banana::$protocole->lastError()); + $body = $_POST['body']; } } } else { @@ -556,8 +556,8 @@ class Banana if (Banana::$profile['signature']) { $body .= "\n\n-- \n" . Banana::$profile['signature']; } - Banana::$page->assign('body', $body); } + Banana::$page->assign('body', $body); Banana::$page->assign('maxfilesize', Banana::$msgedit_maxfilesize); Banana::$page->assign('can_attach', Banana::$msgedit_canattach); diff --git a/banana/nntpcore.inc.php b/banana/nntpcore.inc.php index 5d8bc63..7579c2a 100644 --- a/banana/nntpcore.inc.php +++ b/banana/nntpcore.inc.php @@ -79,7 +79,11 @@ class BananaNNTPCore public function lastError() { - return $this->lasterrortext; + if (!is_utf8($this->lasterrortext)) { + return utf8_encode($this->lasterrortext); + } else { + return $this->lasterrortext; + } } public function backtrace() diff --git a/banana/page.inc.php b/banana/page.inc.php index fef0196..fe6a808 100644 --- a/banana/page.inc.php +++ b/banana/page.inc.php @@ -386,6 +386,7 @@ class BananaPage extends Smarty public function redirect(array $params = array()) { header('Location: ' . $this->makeUrl($params)); + exit; } }