Fixed bug: Charset was not taken into account for single-part messages.
authorgustavf <gustavf@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 24 Mar 2000 11:09:19 +0000 (11:09 +0000)
committergustavf <gustavf@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 24 Mar 2000 11:09:19 +0000 (11:09 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@326 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_messages.php
functions/mime.php

index 00357d62e5f4e905236e62f4c751e2b906140a39..fb996501d9158669df0eada5bcdd4e093294872f 100755 (executable)
@@ -86,7 +86,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["HEADER"]["ENCODING"]);
+      $message["ENTITIES"] = sqimap_get_message_body($imap_stream, $message["HEADER"]["BOUNDARY"], $id, $message["HEADER"]["TYPE0"], $message["HEADER"]["TYPE1"], $message["HEADER"]["ENCODING"], $message["HEADER"]["CHARSET"]);
       return $message;
    }
 
    /******************************************************************************
     **  Returns the body of a message.
     ******************************************************************************/
-   function sqimap_get_message_body ($imap_stream, $bound, $id, $type0, $type1, $encoding) {
+   function sqimap_get_message_body ($imap_stream, $bound, $id, $type0, $type1, $encoding, $charset) {
       fputs ($imap_stream, "a001 FETCH $id:$id BODY[TEXT]\r\n");
       $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
        
       }
       $body = $bodytmp;
 
-      return decodeMime($body, $bound, $type0, $type1, $encoding);
+      return decodeMime($body, $bound, $type0, $type1, $encoding, $charset);
    }
 ?>
index cbc7d205275785e8cad0e01834c54dbfa24bbefd..ecbc6abcf217047c0cfd5e3986afa34e64b77222 100644 (file)
@@ -14,7 +14,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, $encoding, &$entities) {
+   function decodeMime($body, $bound, $type0, $type1, $encoding, $charset, &$entities) {
       if ($type0 == "multipart") {
          $bound = trim($bound);
          $i = 0;
@@ -53,7 +53,7 @@
                      $y++;
                      $j++;
                   }
-                  $ent = decodeMime($ent_body, $ent_bound, $ent_type0, $ent_type1, $entities);
+                  $ent = decodeMime($ent_body, $ent_bound, $ent_type0, $ent_type1, $charset, $entities);
                   $entities = $ent;
                } else {
                   $j++;