summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-11-23 10:46:49 +0000
committeralecpl <alec@alec.pl>2009-11-23 10:46:49 +0000
commitbc6ac4d3c99c55d6b7cb8a3533f62ba5493165e1 (patch)
tree9af4f2febe1ef67de71cd619cfc77559ddc088d6 /program
parent469f84fa49d6ddb22f1eb82d9f0d5aec97af60d8 (diff)
- Fix unicode para and line separators in javascript response (#1486310)
Diffstat (limited to 'program')
-rw-r--r--program/include/main.inc5
1 files changed, 4 insertions, 1 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index bf6fd7b62..89ae1b97f 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -485,12 +485,15 @@ function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
$xml_rep_table['&'] = '&amp;';
for ($c=160; $c<256; $c++) // can be increased to support more charsets
- $xml_rep_table[Chr($c)] = "&#$c;";
+ $xml_rep_table[chr($c)] = "&#$c;";
$xml_rep_table['"'] = '&quot;';
$js_rep_table['"'] = '\\"';
$js_rep_table["'"] = "\\'";
$js_rep_table["\\"] = "\\\\";
+ // Unicode line and paragraph separators (#1486310)
+ $js_rep_table[chr(hexdec(E2)).chr(hexdec(80)).chr(hexdec(A8))] = '&#8232;';
+ $js_rep_table[chr(hexdec(E2)).chr(hexdec(80)).chr(hexdec(A9))] = '&#8233;';
}
// encode for javascript use