Reports: Don't strip valid surrogate pairs
Without the /u (Unicode) flag, [\ud800-\udfff] matches *all* surrogate pair code points, even when they're in a valid position in the string. Fixes #3421
This commit is contained in:
parent
220eba8c63
commit
9779c70915
1 changed files with 1 additions and 1 deletions
|
@ -328,7 +328,7 @@ Zotero.Report.HTML = new function () {
|
|||
|
||||
|
||||
var escapeXML = function (str) {
|
||||
str = str.replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\ud800-\udfff\ufffe\uffff]/g, '\u2B1A');
|
||||
str = str.replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\ud800-\udfff\ufffe\uffff]/gu, '\u2B1A');
|
||||
return Zotero.Utilities.htmlSpecialChars(str);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue