diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js index 7010ee2096..7b67532742 100644 --- a/chrome/content/zotero/xpcom/utilities_internal.js +++ b/chrome/content/zotero/xpcom/utilities_internal.js @@ -2431,6 +2431,12 @@ Zotero.Utilities.Internal = { let nodeStack = targetNode ? [targetNode] : null; let textContent = ''; + // Inserting text with ASCII control character as innerHTML (e.g., in tabBar.jsx) can cause + // an error, so filter out control characters 0-31 and character 127 DEL + // + // https://forums.zotero.org/discussion/118779/special-characters-in-item-title-breaks-the-tab-bar + title = title.replace(/[\x00-\x1F\x7F]/g, ''); + for (let token of title.split(/(<[^>]+>)/)) { if (this._titleMarkup.hasOwnProperty(token)) { let markup = this._titleMarkup[token];