Fix for bug number 110588. Addresses listed in the CC field of reply all messages...
authormattphillips <mattphillips@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 31 Jul 2000 21:31:20 +0000 (21:31 +0000)
committermattphillips <mattphillips@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 31 Jul 2000 21:31:20 +0000 (21:31 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@662 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/strings.php
src/read_body.php

index c3f2e4c..ca54ee8 100644 (file)
 
    /** Returns a line of comma separated email addresses from an array **/
    function getLineOfAddrs($array) {
-      $to_line = "";
-      for ($i = 0; $i < count($array); $i++) {
-         if ($to_line)
-            $to_line = "$to_line, $array[$i]";
-         else
-            $to_line = "$array[$i]";
+      if (is_array($array)) {
+        $to_line = implode(", ", $array);
+        $to_line = trim(ereg_replace(",,+", ",", $to_line));
+      } else {
+        $to_line = "";
       }
       return $to_line;
    }
index bd9fa35..dd597f5 100644 (file)
    $url_replyto = urlencode($message->header->replyto);
 
    $url_replytoall   = urlencode($message->header->replyto);
-   $url_replytoallcc = urlencode(getLineOfAddrs($message->header->to) . ", " . getLineOfAddrs($message->header->cc));
+   $url_replytoallcc = getLineOfAddrs($message->header->to);
+   $url_replytoallcc_cc = getLineOfAddrs($message->header->cc);
+   if ($url_replytoallcc) {
+      if ($url_replytoallcc_cc) {
+         $url_replytoallcc .= ", " . $url_replytoallcc_cc;
+      }
+   } else {
+      if ($url_replytoallcc_cc) {
+         $url_replytoallcc = $url_replytoallcc_cc;
+      } else {
+         $url_replytoallcc = "";
+      }
+   } 
+   $url_replytoallcc = urlencode($url_replytoallcc);
 
    $dateString = getLongDateString($message->header->date);
    $ent_num = findDisplayEntity($message);