Fix references when replying to a post with artid = 0
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Thu, 10 May 2007 22:46:35 +0000 (22:46 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:35:41 +0000 (00:35 +0100)
git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@250 9869982d-c50d-0410-be91-f2a2ec7c7c7b

banana/banana.inc.php.in
banana/nntpcore.inc.php

index df16d8b..77a4d62 100644 (file)
@@ -497,7 +497,7 @@ 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');
             }
index ff82ab8..5d8bc63 100644 (file)
@@ -104,7 +104,7 @@ class BananaNNTPCore
     /** fetch data (and on delimitor)
      * @param STRING $delim string indicating and of transmission
      */
-    private function fetchResult()
+    private function &fetchResult()
     {
         $array = Array();
         while (($result = $this->getLine()) != '.') {
@@ -459,9 +459,9 @@ class BananaNNTPCore
         if (!$this->execLine("XGTITLE $pattern ")) {
             return false;
         }
-        $array  = $this->fetchResult();
+        $array  =& $this->fetchResult();
         $groups = array();
-        foreach ($array as $result) {
+        foreach ($array as &$result) {
             list($group, $desc) = split("[ \t]", $result, 2);
             $groups[$group] = $desc;
         }
@@ -483,7 +483,7 @@ class BananaNNTPCore
         if (!$this->execLine("XHDR $hdr $range ")) {
             return false;
         }
-        $array   = $this->fetchResult();
+        $array   =& $this->fetchResult();
         $headers = array();
         foreach ($array as &$result) {
             @list($head, $value) = explode(' ', $result, 2);
@@ -503,7 +503,7 @@ class BananaNNTPCore
         if (!$this->execLine("XPAT $hdr $range $pat")) {
             return false;
         }
-        $array   = $this->fetchResult();
+        $array   =& $this->fetchResult();
         $headers = array();
         foreach ($array as &$result) {
             list($head, $value) = explode(' ', $result, 2);