From 873c87956ca0156a4ef66231b1b59670d54bcba7 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Wed, 24 Jan 2024 14:59:46 -0500 Subject: [PATCH] Open tabs menu: Escape regex special characters So we don't throw an error/match inappropriately when the filter contains backslashes, periods, pluses, and so on. --- chrome/content/zotero/tabs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/tabs.js b/chrome/content/zotero/tabs.js index 0167f20fa0..02085cd68b 100644 --- a/chrome/content/zotero/tabs.js +++ b/chrome/content/zotero/tabs.js @@ -789,7 +789,7 @@ var Zotero_Tabs = new function () { let xhtmlNS = "http://www.w3.org/1999/xhtml"; let desc = document.createXULElement('description'); - let regex = new RegExp(`(${this._tabsMenuFilter})`, 'gi'); + let regex = new RegExp(`(${Zotero.Utilities.quotemeta(this._tabsMenuFilter)})`, 'gi'); let matches = title.matchAll(regex); let lastIndex = 0;