X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=banana%2Fbanana.inc.php.in;h=386e4c1104aab32fe735134852677bbc9ecc5d58;hb=a3c90095a1920b1d39cb1e8ffd892ba407351ca6;hp=df16d8b9cea33402d9297d5e5eb600735eca29d2;hpb=345c3a8597bd848b94d925ecc3b9e77a583aba2d;p=banana.git diff --git a/banana/banana.inc.php.in b/banana/banana.inc.php.in index df16d8b..386e4c1 100644 --- a/banana/banana.inc.php.in +++ b/banana/banana.inc.php.in @@ -26,6 +26,7 @@ class Banana 'autoup' => 1); static public $boxpattern; static public $withtabs = true; + static public $baseurl = null; static public $mimeparts = array(); ### Spool ### @@ -53,6 +54,11 @@ class Banana static public $msgshow_externalimages = false; static public $msgshow_hasextimages = false; static public $msgshow_withthread = true; + static public $msgshow_javascript = true; + + static public $msgshow_pgpcheck = true; + static public $msgshow_pgppath = 'gpg'; + static public $msgshow_pgpoptions = ''; /** Match an url * Should be included in a regexp delimited using /, !, , or @ (eg: "/$url_regexp/ui") @@ -65,7 +71,7 @@ class Banana * $matches[2] = "http://www.polytechnique.org" * $matches[3] = "]" */ - static public $msgshow_url = '(["\[])?((?:[a-z]+:\/\/|www\.)(?:[\.\,\;\!\:]*[a-z\@0-9~%$£µ&i#\-+=_\/\?]+)+)(["\]])?'; + static public $msgshow_url = '(["\[\<])?((?:[a-z]+:\/\/|www\.)(?:[\.\,\;\!\:]*[a-z\@0-9~%$£µ&i#\-+=_\/\?]+)+)(["\]\>])?'; ### Message edition ### static public $msgedit_canattach = true; @@ -191,6 +197,11 @@ class Banana */ protected function loadParams() { + foreach ($this->params as &$value) { + if ($value === "") { + $value = null; + } + } Banana::$group = isset($this->params['group']) ? $this->params['group'] : null; Banana::$artid = isset($this->params['artid']) ? $this->params['artid'] : null; Banana::$first = isset($this->params['first']) ? $this->params['first'] : null; @@ -497,9 +508,9 @@ class Banana $hdr_values[$header] = str_replace(', ', ',', $hdr_values[$header]); } } - if ($artid) { + if (!is_null($artid)) { $old =& $this->loadMessage($group, $artid); - $hdr_values['References'] = $old->getHeaderValue('references') . $old->getHeaderValue('message-id'); + $hdr_values['References'] = $old->getHeaderValue('references') . ' ' . $old->getHeaderValue('message-id'); } $msg = null; if (isset($_POST['body']) && !is_utf8($_POST['body'])) { @@ -507,8 +518,8 @@ class Banana } if (empty($hdr_values['Subject'])) { Banana::$page->trig(_b_('Le message doit avoir un sujet')); - } elseif (Banana::$msgedit_canattach && isset($_FILES['attachment'])) { - $uploaded = $_FILES['attachment']; + } elseif (Banana::$msgedit_canattach && isset($_FILES['attachment']) && $_FILES['attachment']['name']) { + $uploaded =& $_FILES['attachment']; if (!is_uploaded_file($uploaded['tmp_name'])) { Banana::$page->trig(_b_('Une erreur est survenue lors du téléchargement du fichier')); } else { @@ -522,9 +533,10 @@ class Banana $this->loadSpool($group); $newid = Banana::$spool->updateUnread(Banana::$profile['lastnews']); Banana::$page->redirect(array('group' => $group, 'artid' => $newid ? $newid : $artid)); - } - Banana::$page->trig(_b_('Une erreur est survenue lors de l\'envoi du message :') . '
' + } else { + Banana::$page->trig(_b_('Une erreur est survenue lors de l\'envoi du message :') . '
' . Banana::$protocole->lastError()); + } } } else { if (!is_null($artid)) {