| | |
| | | } |
| | | // text/html |
| | | else if ($part->ctype_secondary == 'html') { |
| | | // charset was converted to UTF-8 in rcube_imap::get_message_part() -> change charset specification in HTML accordingly |
| | | $html = preg_replace('/(\s+content=[\'"]\w+\/\w+;\s+charset)=([a-z0-9-]+)/i', '\\1='.RCMAIL_CHARSET, $part->body); |
| | | |
| | | // clean HTML with washhtml by Frederic Motte |
| | | $body = washtml::wash($part->body, array( |
| | | $body = washtml::wash($html, array( |
| | | 'show_washed' => false, |
| | | 'allow_remote' => $safe, |
| | | 'blocked_src' => "./program/blocked.gif", |
| | | 'charset' => 'UTF-8', |
| | | 'charset' => RCMAIL_CHARSET, |
| | | 'cid_map' => $part->replaces, |
| | | ), $full_inline); |
| | | |
| | |
| | | } |
| | | // text/enriched |
| | | else if ($part->ctype_secondary=='enriched') { |
| | | $part->ctype_secondary = 'html'; |
| | | return Q(enriched_to_html($body), 'show'); |
| | | } |
| | | else |
| | |
| | | // get associative array of headers object |
| | | if (!$headers) |
| | | $headers = is_object($MESSAGE->headers) ? get_object_vars($MESSAGE->headers) : $MESSAGE->headers; |
| | | |
| | | // add empty subject if none exsists |
| | | if (empty($headers['subject'])) |
| | | $headers['subject'] = rcube_label('nosubject'); |
| | | |
| | | $header_count = 0; |
| | | |
| | |
| | | |
| | | $body = rcmail_print_body($part, $safe_mode, !$CONFIG['prefer_html']); |
| | | |
| | | if ($part->ctype_secondary != 'plain') |
| | | if ($part->ctype_secondary == 'html') |
| | | $out .= html::div('message-htmlpart', rcmail_html4inline($body, $attrib['id'])); |
| | | else |
| | | $out .= html::div('message-part', $body); |
| | |
| | | } |
| | | } |
| | | else |
| | | $out .= $MESSAGE->body; |
| | | $out .= html::div('message-part', html::div('pre', Q($MESSAGE->body))); |
| | | |
| | | |
| | | $ctype_primary = strtolower($MESSAGE->structure->ctype_primary); |