From 6084d782f2e6e57248463bf10b99eeee543e0049 Mon Sep 17 00:00:00 2001 From: alecpl Date: Sun, 14 Nov 2010 11:35:38 +0000 Subject: - Fix hanling of HTML entity strings in plai text messages --- program/steps/mail/compose.inc | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'program/steps') diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 471649c04..3f2b8c5d2 100644 --- a/program/steps/mail/compose.inc +++ b/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