From d8ecaec6e406155cac924a91788e40a4402d1f72 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Wed, 16 Mar 2011 23:27:05 +0000 Subject: [PATCH] set a limit on the number of lines used for detect in Bookmarks.js, so that it doesn't break large file import at some point, this should probably be changed to read a fixed number of bytes --- translators/Bookmarks.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/translators/Bookmarks.js b/translators/Bookmarks.js index b8306f2ade..b19aee9212 100644 --- a/translators/Bookmarks.js +++ b/translators/Bookmarks.js @@ -8,7 +8,7 @@ "maxVersion":"", "priority":100, "inRepository":true, - "lastUpdated":"2011-02-10 04:31:00" + "lastUpdated":"2011-03-16 23:24:54" } /* @@ -48,13 +48,15 @@ */ +const MAX_DETECT_LINES = 150; function detectImport() { var text = ""; var line; var match; var re = /
\s*]*HREF="([^"]+)"[^>]*>([^<\n]+)/gi; - while((line = Zotero.read()) !== false) { + var i = 0; + while((line = Zotero.read()) !== false && (i++ < MAX_DETECT_LINES)) { text += line; match = re.exec(text); if (match) {