summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/mail')
-rw-r--r--program/steps/mail/compose.inc17
1 files changed, 14 insertions, 3 deletions
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 . '</textarea>';
+ }
+
$out .= $form_end ? "\n$form_end" : '';
$OUTPUT->set_env('composebody', $attrib['id']);