X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=banana%2Fbanana.inc.php.in;h=86df2508d2f21e16badafb7b5d4b5a4dda9e2173;hb=ee5478a3f239b39d1481a9f3390c3e8701a556e5;hp=0166d80543df4aa97a53164fabb1c72a2fffcb2b;hpb=ab663ccb8e5063ffa0598032e869b8b0ebeaaa91;p=banana.git diff --git a/banana/banana.inc.php.in b/banana/banana.inc.php.in index 0166d80..86df250 100644 --- a/banana/banana.inc.php.in +++ b/banana/banana.inc.php.in @@ -53,7 +53,7 @@ class Banana * $matches[2] = "http://www.polytechnique.org" * $matches[3] = "]" */ - var $url_regexp = '(["\[])?((?:https?|ftp|news)://(?:&|,?[a-z@0-9.~%$£µ&i#\-+=_/\?])*)(["\]])?'; + var $url_regexp = '(["\[])?((?:https?|ftp|news)://(?:&|\.*,*[a-z@0-9~%$£µ&i#\-+=_/\?])*)(["\]])?'; /** Boundary for multipart messages @@ -316,10 +316,14 @@ class Banana . "\n" . "Message canceled with Banana"; if ($this->nntp->post($msg)) { + $ndx = $this->spool->getndx($artid) - 1; + if ($ndx > 50) { + $ndx = 0; + } $this->spool->delid($id); $this->nntp->quit(); redirectInBanana(Array('group' => $group, - 'first' => $id)); + 'first' => $ndx)); } else { return '

'._b_('Impossible d\'annuler le message').'

'; } @@ -335,18 +339,27 @@ class Banana $body = $_POST['body']; $target = $_POST['newsgroups']; $followup = $_POST['followup']; - $this->state['page'] = 'message'; + $this->state['page'] = 'action'; + $this->state['group'] = $group; + $this->state['action'] = 'new'; + if ($id != -1) { + $this->state['artid'] = $id; + } } elseif ($id > 0) { $this->nntp->group($group); if ($this->_newPost($id)) { - $subject = preg_replace("/^re\s*:\s*/i", '', 'Re: '.$this->post->headers['subject']); - $body = utf8_encode($this->post->name." "._b_("a écrit"))." :\n" - . wrap($this->post->get_body(), "> ") - . $this->profile['sig'] ? "\n\n-- \n". $this->profile['sig'] : ''; + $subject = 'Re: ' . preg_replace("/^re\s*:\s*/i", '', $this->post->headers['subject']); + $body = to_entities(utf8_encode($this->post->name." "._b_("a écrit"))." :\n" + . wrap($this->post->get_body(), "> ")) + . ($this->profile['sig'] ? "\n\n-- \n". $this->profile['sig'] : ''); $target = isset($this->post->headers['followup-to']) ? $this->post->headers['followup-to'] : $this->post->headers['newsgroups']; $followup = null; } + } else { + $targe = $group; + $subject = $followup = null; + $body = $this->profile['sig'] ? "\n\n-- \n". $this->profile['sig'] : ''; } $this->nntp->quit(); @@ -368,7 +381,7 @@ class Banana . '' . $this->profile['org'] . '' . '' . _b_('Corps') . '' . ''; + . $body . ''; if ($this->can_attach) { $html .= '' . _b_('Pièce jointe') . '' . '' @@ -376,8 +389,8 @@ class Banana . ''; } $html .= ''; - if ($id > 0) { - $html .= ''; + if ($id != -1) { + $html .= ''; } $html .= '' . '' @@ -466,11 +479,12 @@ class Banana if ($this->nntp->post($msg)) { $dir = Array('group' => $group); if ($artid != -1) { - $dir['first'] = $artid; + $dir['artid'] = $artid; } redirectInBanana($dir); } else { - return '

' . _b_('Impossible de poster le message') . '

' + return '

' . _b_('Impossible de poster le message. Le serveur a retourné l\'erreur :') . '

' + . '
' . utf8_encode($this->nntp->lasterrortext) .'
' . $this->action_newFup($group, $artid); } }