summaryrefslogtreecommitdiff
path: root/program/include/main.inc
diff options
context:
space:
mode:
Diffstat (limited to 'program/include/main.inc')
-rw-r--r--program/include/main.inc5
1 files changed, 3 insertions, 2 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index b2e83b767..676883305 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -958,8 +958,9 @@ 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('/&([a-z]{2,5});/', '&\\1;', strtr($str, $encode_arr));
return $newlines ? nl2br($out) : $out;
}