From 56849c658b023ba8143c60435ddec2ee225fc11d Mon Sep 17 00:00:00 2001 From: thomascube Date: Thu, 6 Jan 2011 11:48:11 +0000 Subject: Wrap HTML parts with and add Doctype declaration (#1487098) --- CHANGELOG | 1 + program/steps/mail/sendmail.inc | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 652ac2b58..e9af27849 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Wrap HTML parts with and add Doctype declaration (#1487098) - Make rcube_autoload silently skip unknown classes (#1487109) - Fix charset detection in vcards with encoded values (#1485542) - Better CSS cursors for splitters (#1486874) diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index 09f12ed07..770660c1d 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -166,7 +166,7 @@ function rcmail_email_input_format($mailto, $count=false, $check=true) $name = trim($name); if ($name && ($name[0] != '"' || $name[strlen($name)-1] != '"') && preg_match('/[\(\)\<\>\\\.\[\]@,;:"]/', $name)) { - $name = '"'.addcslashes($name, '"').'"'; + $name = '"'.addcslashes($name, '"').'"'; } $address = idn_to_ascii($address); if (!preg_match('/^<\S+@\S+>$/', $address)) @@ -399,7 +399,11 @@ if (!$savedraft) { // add inline css for blockquotes $bstyle = 'padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; width:100%'; $message_body = preg_replace('/
/', - '
', $message_body); + '
', $message_body); + + // append doctype and html/body wrappers + $message_body = '' . + "\r\n\r\n" . $message_body; } // generic footer for all messages @@ -415,6 +419,8 @@ if (!$savedraft) { } if ($footer) $message_body .= "\r\n" . $footer; + if ($isHtml) + $message_body .= "\r\n\r\n"; } // set line length for body wrapping -- cgit v1.2.3