summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-11-11 13:39:10 +0000
committeralecpl <alec@alec.pl>2010-11-11 13:39:10 +0000
commitd2b27d11759cd1c668293a569aed1afaa7cfd741 (patch)
tree35e4f39bcf81833b21066d42a53c6ff38671ca12
parentd4711f98408487e7065e729285817c38dde3d097 (diff)
- Fix displaying of text/plain messages containing HTML entities
-rw-r--r--program/include/main.inc10
1 files changed, 7 insertions, 3 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index 4bf721336..31c9a0805 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -556,10 +556,14 @@ function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
}
else if ($mode=='remove')
$str = strip_tags($str);
-
+
+ $out = strtr($str, $encode_arr);
+
// avoid douple quotation of &
- $out = preg_replace('/&amp;([A-Za-z]{2,6}|#[0-9]{2,4});/', '&\\1;', strtr($str, $encode_arr));
-
+ // commented out, because this breaks displaying of text with entity strings
+ // in text messages.
+ //$out = preg_replace('/&amp;([A-Za-z]{2,6}|#[0-9]{2,4});/', '&\\1;', $out);
+
return $newlines ? nl2br($out) : $out;
}