commit 6952f469866085aa98723a40db5def53cf9eb746 parent 61864e903f8f6bbaf014a0d27fc178e777a51be7 Author: Dan Stillman <dstillman@zotero.org> Date: Sun, 14 Apr 2013 21:20:24 -0400 Fix Attachment Content regexp search Diffstat:
| M | 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 @@ -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);