I applied the patch proposed in (patch #516542)
[squirrelmail.git] / functions / mime.php
index bca1611490aea34da4004fb137ed98fe94ce6433..92927d68f7a89cc5fa3f0a795397c9127694b5d2 100644 (file)
@@ -553,6 +553,7 @@ function findDisplayEntity ($message, $textOnly = 1)   {
     if ($message) {
         if ( $message->header->type0 == 'multipart' &&
              ( $message->header->type1 == 'alternative' ||
+               $message->header->type1 == 'mixed' ||
                $message->header->type1 == 'related' ) &&
              $show_html_default && ! $textOnly ) {
             $entity = findDisplayEntityHTML($message);
@@ -640,9 +641,9 @@ function formatBody($imap_stream, $message, $color, $wrap_at) {
         $body .= "<CENTER><SMALL><A HREF=\"../src/download.php?absolute_dl=true&amp;passed_id=$id&amp;passed_ent_id=$ent_num&amp;mailbox=$urlmailbox&amp;showHeaders=1\">". _("Download this as a file") ."</A></SMALL></CENTER><BR>";
        if ($has_unsafe_images) {
            if ($view_unsafe_images) {
-                $body .= "<CENTER><SMALL><A HREF=\"read_body.php?passed_id=$id&amp;mailbox=$urlmailbox&amp;sort=$sort&amp;startMessage=$startMessage&amp;show_more=0\">". _("Don't view unsafe images") ."</A></SMALL></CENTER><BR>\n";
+                $body .= "<CENTER><SMALL><A HREF=\"read_body.php?passed_id=$id&amp;mailbox=$urlmailbox&amp;sort=$sort&amp;startMessage=$startMessage&amp;show_more=0\">". _("Hide Unsafe Images") ."</A></SMALL></CENTER><BR>\n";
             } else {
-                $body .= "<CENTER><SMALL><A HREF=\"read_body.php?passed_id=$id&amp;mailbox=$urlmailbox&amp;sort=$sort&amp;startMessage=$startMessage&amp;show_more=0&amp;view_unsafe_images=1\">". _("View unsafe images") ."</A></SMALL></CENTER><BR>\n";
+                $body .= "<CENTER><SMALL><A HREF=\"read_body.php?passed_id=$id&amp;mailbox=$urlmailbox&amp;sort=$sort&amp;startMessage=$startMessage&amp;show_more=0&amp;view_unsafe_images=1\">". _("View Unsafe Images") ."</A></SMALL></CENTER><BR>\n";
             }
        }
 
@@ -1167,10 +1168,12 @@ function stripEvent( &$i, $j, &$body, $id, $base ) {
                     $src .= $body{$k};
                     $k++;
                 }
+                $k++;
                 while( !isNoSep( $body{$k} ) &&
                        $k < $j ) {
                     $k++;
                 }
+                $k++;
                 if ( strtolower( substr( $src, 0, 4 ) ) == 'cid:' ) {
                     $src = substr( $src, 4 );
                     $src = "../src/download.php?absolute_dl=true&amp;passed_id=$id&amp;mailbox=" .