Redid the way folders are listed
[squirrelmail.git] / functions / mailbox.php
index 8babee25da3c04a93b0c52d194eef12a7ad1ed9b..9febb9417f4efcfc45f49ed69a07be03ba73a4ac 100644 (file)
@@ -66,8 +66,7 @@
          while ((substr($read, 0, 15) != "messageFetch OK") && (substr($read, 0, 16) != "messageFetch BAD")) {
 
             if (substr($read, 0, 5) == "From:") {
-               $read = ereg_replace("<", "EMAILSTART--", $read);
-               $read = ereg_replace(">", "--EMAILEND", $read);
+               $read = encodeEmailAddr("$read");
                $from[$pos] = substr($read, 5, strlen($read) - 6);
             }
             else if (substr($read, 0, 5) == "Date:") {
       }
    }
 
+   function encodeEmailAddr($string) {
+      $string = ereg_replace("<", "EMAILSTART--", $string);
+      $string = ereg_replace(">", "--EMAILEND", $string);
+      return $string;
+   }
+
    function setMessageFlag($imapConnection, $i, $q, $flag) {
       fputs($imapConnection, "messageStore STORE $i:$q +FLAGS (\\$flag)\n");
    }