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 c3f2e4c0ad6f18857482efb404a88d8e6b502ba1..ca54ee843a3319feb355ffcab0b6838c3f850fc6 100644 (file)
 
    /** Returns a line of comma separated email addresses from an array **/
    function getLineOfAddrs($array) {
 
    /** 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;
    }
       }
       return $to_line;
    }
index bd9fa35a8c7545215b3465984ba9a25f4138ded5..dd597f5aae1311506c72c8b9082af84f2d714bae 100644 (file)
    $url_replyto = urlencode($message->header->replyto);
 
    $url_replytoall   = urlencode($message->header->replyto);
    $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);
 
    $dateString = getLongDateString($message->header->date);
    $ent_num = findDisplayEntity($message);