Fix Attachment Content regexp search

This commit is contained in:
Dan Stillman 2013-04-14 21:20:24 -04:00
parent 61864e903f
commit 6952f46986

View file

@ -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);