Fixed bug I noticed when ONLY an attachment is sent (no text message), it
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 20 Sep 2000 05:13:07 +0000 (05:13 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 20 Sep 2000 05:13:07 +0000 (05:13 +0000)
would display junk.  Now it shows the attachment box.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@749 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
functions/mime.php

index ab657b73d6aabfa5f445ec32f8fafe16600831e7..7348175abf54649e73ab4dfbe73f4c311cc2e2d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 Version 0.5 -- DEVELOPMENT
 --------------------------
+- Fixed some lingering bugs in mime parsing 
+- Searching specifies CHARSET option
 - Security fixes
 - Fixed hyperlink rendering problems
 
index f56f54d86db02e3c159750b50852ad48444ea982..c837fd8d716b68fc6739dc0d91e0edf3a089984e 100644 (file)
       // Get the right entity and redefine message to be this entity
       $ent_num = findDisplayEntity ($message);
       $body_message = getEntity($message, $ent_num);
-
-      $body = mime_fetch_body ($imap_stream, $id, $ent_num); 
-      $body = decodeBody($body, $body_message->header->encoding);
-
-      // If there are other types that shouldn't be formatted, add
-      // them here 
-      if ($message->header->type1 != "html") {   
-         $body = translateText($body, $wrap_at, $body_message->header->charset);
-      }   
-
-      $body .= "<SMALL><CENTER><A HREF=\"../src/download.php?absolute_dl=true&passed_id=$id&passed_ent_id=$ent_num&mailbox=$urlmailbox\">". _("Download this as a file") ."</A></CENTER><BR></SMALL>";
-
-      /** Display the ATTACHMENTS: message if there's more than one part **/
-      if ($message->entities) {
+      if (($body_message->header->type0 == "text") || 
+          ($body_message->header->type0 == "rfc822")) {
+   
+         $body = mime_fetch_body ($imap_stream, $id, $ent_num); 
+         $body = decodeBody($body, $body_message->header->encoding);
+   
+         // If there are other types that shouldn't be formatted, add
+         // them here 
+         if ($message->header->type1 != "html") {   
+            $body = translateText($body, $wrap_at, $body_message->header->charset);
+         }   
+   
+         $body .= "<SMALL><CENTER><A HREF=\"../src/download.php?absolute_dl=true&passed_id=$id&passed_ent_id=$ent_num&mailbox=$urlmailbox\">". _("Download this as a file") ."</A></CENTER><BR></SMALL>";
+   
+         /** Display the ATTACHMENTS: message if there's more than one part **/
+         if ($message->entities) {
+            $body .= "</TD></TR></TABLE>";
+            $body .= "<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=4 BORDER=0><TR><TD BGCOLOR=\"$color[0]\">";
+            $body .= "<TT><B>ATTACHMENTS:</B></TT>";
+            $body .= "</TD></TR><TR><TD BGCOLOR=\"$color[0]\">";
+            $num = 0;
+   
+            $body .= formatAttachments ($message, $ent_num, $message->header->mailbox, $id);
+            $body .= "</TD></TR></TABLE>";
+         } else {
+            $body .= "</TD></TR></TABLE>";
+         }
+      } else {
          $body .= "</TD></TR></TABLE>";
          $body .= "<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=4 BORDER=0><TR><TD BGCOLOR=\"$color[0]\">";
          $body .= "<TT><B>ATTACHMENTS:</B></TT>";
          $body .= "</TD></TR><TR><TD BGCOLOR=\"$color[0]\">";
          $num = 0;
 
-         $body .= formatAttachments ($message, $ent_num, $message->header->mailbox, $id);
-         $body .= "</TD></TR></TABLE>";
-      } else {
+         $body .= formatAttachments ($message, 999999, $message->header->mailbox, $id);
          $body .= "</TD></TR></TABLE>";
       }
       return $body;