From 9779c709158f870075ff2bc83ca0652616cdc7eb Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Thu, 21 Sep 2023 13:19:02 -0400 Subject: [PATCH] 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 --- chrome/content/zotero/xpcom/report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/report.js b/chrome/content/zotero/xpcom/report.js index cc69583e90..3eebc03d32 100644 --- a/chrome/content/zotero/xpcom/report.js +++ b/chrome/content/zotero/xpcom/report.js @@ -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); } }