| | |
| | | * @param array CID map replaces (inline images) |
| | | * @return string Clean HTML |
| | | */ |
| | | function rcmail_wash_html($html, $p = array(), $cid_replaces) |
| | | function rcmail_wash_html($html, $p, $cid_replaces) |
| | | { |
| | | global $REMOTE_OBJECTS; |
| | | |
| | |
| | | // allow CSS styles, will be sanitized by rcmail_washtml_callback() |
| | | if (!$p['skip_washer_style_callback']) |
| | | $washer->add_callback('style', 'rcmail_washtml_callback'); |
| | | |
| | | // Remove non-UTF8 characters (#1487813) |
| | | $html = rc_utf8_clean($html); |
| | | |
| | | $html = $washer->wash($html); |
| | | $REMOTE_OBJECTS = $washer->extlinks; |
| | |
| | | |
| | | // previous line is flowed? |
| | | if (isset($body[$last]) && $body[$n] |
| | | && $last != $last_sig |
| | | && $last !== $last_sig |
| | | && $body[$last][strlen($body[$last])-1] == ' ' |
| | | ) { |
| | | $body[$last] .= $body[$n]; |
| | |
| | | rcmail_plain_body(Q($MESSAGE->body, 'strict', false)))); |
| | | } |
| | | |
| | | $ctype_primary = strtolower($MESSAGE->structure->ctype_primary); |
| | | $ctype_secondary = strtolower($MESSAGE->structure->ctype_secondary); |
| | | |
| | | // list images after mail body |
| | | if ($CONFIG['inline_images'] |
| | | && $ctype_primary == 'multipart' |
| | | && !empty($MESSAGE->attachments)) |
| | | { |
| | | if ($CONFIG['inline_images'] && !empty($MESSAGE->attachments)) { |
| | | foreach ($MESSAGE->attachments as $attach_prop) { |
| | | // Content-Type: image/*... |
| | | if (preg_match('/^image\//i', $attach_prop->mimetype) || |
| | |
| | | ) { |
| | | $out .= html::tag('hr') . html::p(array('align' => "center"), |
| | | html::img(array( |
| | | 'src' => $MESSAGE->get_part_url($attach_prop->mime_id), |
| | | 'src' => $MESSAGE->get_part_url($attach_prop->mime_id, true), |
| | | 'title' => $attach_prop->filename, |
| | | 'alt' => $attach_prop->filename, |
| | | ))); |