Fixed bug: Encoding was not set correctly when message was not multipart.
authorgustavf <gustavf@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 29 Feb 2000 11:52:15 +0000 (11:52 +0000)
committergustavf <gustavf@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 29 Feb 2000 11:52:15 +0000 (11:52 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@249 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_messages.php
functions/mime.php

index 6fb89d9..851b91e 100755 (executable)
@@ -88,7 +88,7 @@
       $message["INFO"]["ID"] = $id;
       $message["INFO"]["MAILBOX"] = $mailbox;
       $message["HEADER"] = sqimap_get_message_header($imap_stream, $id);
-      $message["ENTITIES"] = sqimap_get_message_body($imap_stream, $message["HEADER"]["BOUNDARY"], $id, $message["HEADER"]["TYPE0"], $message["HEADER"]["TYPE1"]);
+      $message["ENTITIES"] = sqimap_get_message_body($imap_stream, $message["HEADER"]["BOUNDARY"], $id, $message["HEADER"]["TYPE0"], $message["HEADER"]["TYPE1"], $message["HEADER"]["ENCODING"]);
       return $message;
    }
 
    /******************************************************************************
     **  Returns the body of a message.
     ******************************************************************************/
-   function sqimap_get_message_body ($imap_stream, $bound, $id, $type0, $type1) {
+   function sqimap_get_message_body ($imap_stream, $bound, $id, $type0, $type1, $encoding) {
       fputs ($imap_stream, "a001 FETCH $id:$id BODY[TEXT]\n");
       $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
        
          $i++;
       }
       $body = $bodytmp;
-      return decodeMime($body, $bound, $type0, $type1);
+
+      return decodeMime($body, $bound, $type0, $type1, $encoding);
    }
 ?>
index e2cac35..2ff5d65 100644 (file)
@@ -11,7 +11,7 @@
    /** This is the first function called.  It decides if this is a multipart
        message or if it should be handled as a single entity
     **/
-   function decodeMime($body, $bound, $type0, $type1, &$entities) {
+   function decodeMime($body, $bound, $type0, $type1, $encoding, &$entities) {
       if ($type0 == "multipart") {
          $bound = trim($bound);
          $i = 0;