Explorar el Código

fix for viewing html entities with images involved.
We have to pass the complete message object to magicHTML to find the related
images.

stekkel hace 23 años
padre
commit
f09933f3f2
Se han modificado 1 ficheros con 6 adiciones y 5 borrados
  1. 6 5
      src/view_text.php

+ 6 - 5
src/view_text.php

@@ -14,9 +14,12 @@
    $mbx_response =  sqimap_mailbox_select($imapConnection, $mailbox);
 
    $message = &$messages[$mbx_response['UIDVALIDITY']]["$passed_id"];
-   $message = &$message->getEntity($ent_id);
+   $message_ent = &$message->getEntity($ent_id);
+   if ($passed_ent_id) {
+      $message = &$message->getEntity($passed_ent_id);
+   }
    
-   $header = $message->header;
+   $header = $message_ent->header;
    $charset = $header->getParameter('charset');
    $type0 = $header->type0;
    $type1 = $header->type1;
@@ -44,9 +47,7 @@
          "<TABLE WIDTH=\"98%\" BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">".
          "<TR><TD BGCOLOR=\"$color[4]\"><TT>";
     if ($type1 == 'html' || $override_type1 == 'html') {
-        $msg  = sqimap_get_message($imapConnection, $passed_id, $mailbox);
-	$msg = $msg->getEntity($ent_id);
-        $body = MagicHTML( $body, $passed_id, $msg );
+        $body = MagicHTML( $body, $passed_id, $message, $mailbox);
     } else {
         translateText($body, $wrap_at, $charset);
     }