From 4a691c9b2444774dd9b18d8feafe095956a7351e Mon Sep 17 00:00:00 2001 From: lkehresman Date: Mon, 13 Mar 2000 12:04:39 +0000 Subject: [PATCH] fixed the problem with no attachments git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@299 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_messages.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/functions/imap_messages.php b/functions/imap_messages.php index 58a22869..c219b80d 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -118,12 +118,12 @@ ******************************************************************************/ function sqimap_get_header ($imap_stream, $read) { $i = 0; + // Set up some defaults + $header["TYPE0"] = "text"; + $header["TYPE1"] = "plain"; + $header["CHARSET"] = "us-ascii"; + 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,7 +136,7 @@ } /** CONTENT-TYPE **/ - else if (substr($read[$i], 0, 13) == "Content-Type:") { + else if (strtolower(substr($read[$i], 0, 13)) == "content-type:") { $cont = strtolower(trim(substr($read[$i], 13))); if (strpos($cont, ";")) $cont = substr($cont, 0, strpos($cont, ";")); @@ -149,6 +149,7 @@ $header["TYPE0"] = $cont; } + $line = $read[$i]; $i++; while ( (substr(substr($read[$i], 0, strpos($read[$i], " ")), -1) != ":") && (trim($read[$i]) != "") && (trim($read[$i]) != ")")) { -- 2.25.1