Added basic CSS support.
[squirrelmail.git] / functions / imap_messages.php
index 9898710ecc95477b87122f18430493233858c530..d7f01665e22754b58daf34b04311e1b00c16589b 100755 (executable)
@@ -64,7 +64,7 @@
             $date = substr($read[$i], 5);
          } else if (eregi ("^subject:", $read[$i])) {
             $subject = htmlspecialchars(eregi_replace ("^subject: ", "", $read[$i]));
-            if (strlen($subject) == 0)
+            if (strlen(Chop($subject)) == 0)
                $subject = _("(no subject)");
          }
                }       
             $pos = 0;
             $header["CC"][$pos] = trim(substr($read[$i], 4));
             $i++;
-            while ((substr($read[$i], 0, 1) == " ") && (trim($read[$i]) != "")) {
+            while (((substr($read[$i], 0, 1) == " ") || (substr($read[$i], 0, 1) == "\t"))  && (trim($read[$i]) != "")){
                $pos++;
                $header["CC"][$pos] = trim($read[$i]);
                $i++;
             $pos = 0;
             $header["TO"][$pos] = trim(substr($read[$i], 4));
             $i++;
-            while ((substr($read[$i], 0, 1) == " ")  && (trim($read[$i]) != "")){
+            while (((substr($read[$i], 0, 1) == " ") || (substr($read[$i], 0, 1) == "\t"))  && (trim($read[$i]) != "")){
                $pos++;
                $header["TO"][$pos] = trim($read[$i]);
                $i++;
 
          /** ERROR CORRECTION **/
          else if (substr($read[$i], 0, 1) == ")") {
-            if ($header["SUBJECT"] == "")
+            if (strlen(trim($header["SUBJECT"])) == 0)
                 $header["SUBJECT"] = _("(no subject)");
 
-            if ($header["FROM"] == "")
+            if (strlen(trim($header["FROM"])) == 0)
                 $header["FROM"] = _("(unknown sender)");
 
-            if ($header["DATE"] == "")
+            if (strlen(trim($header["DATE"])) == 0)
                 $header["DATE"] = time();
             $i++;
          }