浏览代码

added defaults if no mime type is available

Luke Ehresman 25 年之前
父节点
当前提交
b70d28043f
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      functions/imap_messages.php

+ 6 - 0
functions/imap_messages.php

@@ -119,6 +119,11 @@
    function sqimap_get_header ($imap_stream, $read) {
       $i = 0;
       while ($i < count($read)) {
+         // Set up some defaults
+         $header["TYPE0"] = "text";
+         $header["TYPE1"] = "plain";
+         $header["CHARSET"] = "us-ascii";
+         
          if (substr($read[$i], 0, 17) == "MIME-Version: 1.0") {
             $header["MIME"] = true;
             $i++;
@@ -136,6 +141,7 @@
             if (strpos($cont, ";"))
                $cont = substr($cont, 0, strpos($cont, ";"));
 
+
             if (strpos($cont, "/")) {
                $header["TYPE0"] = substr($cont, 0, strpos($cont, "/"));
                $header["TYPE1"] = substr($cont, strpos($cont, "/")+1);