Changed regexps
[squirrelmail.git] / src / read_body.php
index c35e5d115df3057b4a3a592360516a7042af8328..c29b9497b24a15e8c6bf237697bedea31db76e77 100644 (file)
    // add them to the list.  Remove duplicates.
    // This is somewhat messy, so I'll explain:
    // 1) Take all addresses (from, to, cc) (avoid nasty join errors here)
-   if (!is_array($message->header->to)) { $message->header->cc = array($message->header->to); }
-   if (!is_array($message->header->cc)) { $message->header->cc = array($message->header->cc); }
    $url_replytoall_extra_addrs = array_merge(array($message->header->from),
       $message->header->to, $message->header->cc);
 
    $url_replytoall_extra_addrs = parseAddrs($url_replytoall_extra_addrs);
    
    // 4) Make them unique -- weed out duplicates
-   if (function_exists("array_unique")) {
-      $url_replytoall_extra_addrs = array_unique($url_replytoall_extra_addrs);
-   }
+   // (Coded for PHP 4.0.0)
+   $url_replytoall_extra_addrs =
+      array_keys(array_flip($url_replytoall_extra_addrs));
    
    // 5) Remove the addresses we'll be sending the message 'to'
    $url_replytoall_avoid_addrs = parseAddrs($message->header->replyto);