diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 84ec3c32a..505f5d644 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -1145,8 +1145,24 @@ function rcmail_create_draft_body($body, $bodyIsHtml) if ($bodyIsHtml) { $body = rcmail_wash_html($body, array('safe' => 1), $cid_map); - // remove comments (produced by washtml) - $body = preg_replace('//', '', $body); + // cleanup + $body = preg_replace(array( + // remove comments (produced by washtml) + '//', + // remove
tags + '/]*)>/i', + '/<\/body>/i', + // convert TinyMCE's empty-line sequence (#1490463) + '/\xC2\xA0<\/p>/', + ), + array( + '', + '', + '', + '
/', - '//' + '//', + // convert TinyMCE's new-line sequences (#1490463) + '/<\/p>/', ), array( + '', '', '
', - '' + '', + '', ), $message_body); }