From 6952f469866085aa98723a40db5def53cf9eb746 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 14 Apr 2013 21:20:24 -0400 Subject: [PATCH] Fix Attachment Content regexp search --- chrome/content/zotero/xpcom/fulltext.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/fulltext.js b/chrome/content/zotero/xpcom/fulltext.js index adf9a54df6..559397d2c1 100644 --- a/chrome/content/zotero/xpcom/fulltext.js +++ b/chrome/content/zotero/xpcom/fulltext.js @@ -575,8 +575,14 @@ Zotero.Fulltext = new function(){ flags += 'i'; } - var re = new RegExp(searchText, flags); - var matches = re(str); + try { + var re = new RegExp(searchText, flags); + var matches = re.exec(str); + } + catch (e) { + Zotero.debug(e, 1); + Components.utils.reportError(e); + } if (matches){ Zotero.debug("Text found"); return str.substr(matches.index, 50);