diff options
author | alecpl <alec@alec.pl> | 2010-11-14 11:35:38 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-11-14 11:35:38 +0000 |
commit | 6084d782f2e6e57248463bf10b99eeee543e0049 (patch) | |
tree | bc572a63acf8c03a24ad3fa903e679eaa783d7c1 /program/steps | |
parent | a4c970508b899fd9e467b33319d689470908a24c (diff) |
- Fix hanling of HTML entity strings in plai text messages
Diffstat (limited to 'program/steps')
-rw-r--r-- | program/steps/mail/compose.inc | 17 |
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']); |