Browse Source

fix for decode different entities

stekkel 23 năm trước cách đây
mục cha
commit
942fba4bc2
1 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 4 4
      src/compose.php

+ 4 - 4
src/compose.php

@@ -465,11 +465,11 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se
         $encoding = $message->header->encoding;
 	$type0 = $message->type0;
 	$type1 = $message->type1;
-
         foreach ($entities as $ent) {
-           $bodypart = decodeBody(
-	              mime_fetch_body($imapConnection, $passed_id, $ent),
-                      $encoding);
+           $unencoded_bodypart = mime_fetch_body($imapConnection, $passed_id, $ent);
+	   $body_part_entity = $message->getEntity($ent);
+	   $bodypart = decodeBody($unencoded_bodypart,
+	                          $body_part_entity->header->encoding);
 	   if ($type1 == 'html') {
               $bodypart = strip_tags($bodypart);
     	   }