Added headerfield type for use with multipart/related messages
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 15 Apr 2002 21:32:18 +0000 (21:32 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 15 Apr 2002 21:32:18 +0000 (21:32 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2726 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_messages.php

index 48d8011..a6dac21 100755 (executable)
@@ -607,6 +607,18 @@ function sqimap_get_header ($imap_stream, $read) {
             } else {
                 $hdr->charset = "us-ascii";
             }
+           /* Detect type in case of multipart/related */
+           if (strpos(strtolower(trim($line)), "type=")) {
+               $pos = strpos($line, "type=") + 6;
+               $type = trim($line);
+                if (strpos($line, ";", $pos) > 0) {
+                    $type = substr($type, $pos, strpos($line, ";", $pos)-$pos);
+                } else {
+                    $type = substr($charset, $pos);
+                }
+               $type = str_replace("\"",'',$type);
+               $hdr->type = $type;
+           }
         }
         else if (strtolower(substr($read[$i], 0, 20)) == "content-disposition:") {
             /* Add better content-disposition support */