From a66fd7b8815b120becb59e92cc02b4c8a3d77679 Mon Sep 17 00:00:00 2001 From: alec Date: Sun, 14 Nov 2010 11:35:38 +0000 Subject: - Fix hanling of HTML entity strings in plai text messages git-svn-id: https://svn.roundcube.net/trunk@4223 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/steps/mail/compose.inc | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'roundcubemail/program/steps') diff --git a/roundcubemail/program/steps/mail/compose.inc b/roundcubemail/program/steps/mail/compose.inc index 471649c04..3f2b8c5d2 100644 --- a/roundcubemail/program/steps/mail/compose.inc +++ b/roundcubemail/program/steps/mail/compose.inc @@ -646,9 +646,20 @@ function rcmail_compose_body($attrib) $out .= $msgtype->show(); // If desired, set this textarea to be editable by TinyMCE - if ($isHtml) $attrib['class'] = 'mce_editor'; - $textarea = new html_textarea($attrib); - $out .= $textarea->show($MESSAGE_BODY); + if ($isHtml) { + $attrib['class'] = 'mce_editor'; + $textarea = new html_textarea($attrib); + $out .= $textarea->show($MESSAGE_BODY); + } + else { + $textarea = new html_textarea($attrib); + $out .= $textarea->show(''); + // quote plain text, inject into textarea + $table = get_html_translation_table(HTML_SPECIALCHARS); + $MESSAGE_BODY = strtr($MESSAGE_BODY, $table); + $out = substr($out, 0, -11) . $MESSAGE_BODY . ''; + } + $out .= $form_end ? "\n$form_end" : ''; $OUTPUT->set_env('composebody', $attrib['id']); -- cgit v1.2.3