From a4c970508b899fd9e467b33319d689470908a24c Mon Sep 17 00:00:00 2001 From: alecpl Date: Sun, 14 Nov 2010 10:09:14 +0000 Subject: - Re-fix handling of html entity strings in plain/text messages --- program/include/main.inc | 4 +--- program/steps/mail/func.inc | 8 ++++++-- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'program') diff --git a/program/include/main.inc b/program/include/main.inc index d2cac3227..301e2f716 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -560,9 +560,7 @@ function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE) $out = strtr($str, $encode_arr); // avoid douple quotation of & - // commented out, because this breaks displaying of text with entity strings - // in text messages. - //$out = preg_replace('/&([A-Za-z]{2,6}|#[0-9]{2,4});/', '&\\1;', $out); + $out = preg_replace('/&([A-Za-z]{2,6}|#[0-9]{2,4});/', '&\\1;', $out); return $newlines ? nl2br($out) : $out; } diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 747dce529..c7498d5b1 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -831,8 +831,12 @@ function rcmail_plain_body($body, $flowed=false) $quote_level = $q; } - // quote plain text - $body = Q(join("\n", $a_lines), 'dummy', false); + $body = join("\n", $a_lines); + + // quote plain text (don't use Q() here, to display entities "as is") + $table = get_html_translation_table(HTML_SPECIALCHARS); + unset($table['?']); + $body = strtr($body, $table); // colorize signature (up to lines) $len = strlen($body); -- cgit v1.2.3