commit 52b95bfc032a7602227db7784bf3deab89bab012
parent 10898566228d28a11ed334a69937c7e9a8bb706a
Author: Dan Stillman <dstillman@zotero.org>
Date: Fri, 18 Oct 2013 16:41:04 -0400
Read 200 bytes instead of 128 in Zotero.File.getSample()
This allows Zotero to detect PDFs with more gibberish at the beginning.
https://forums.zotero.org/discussion/32550
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/xpcom/file.js b/chrome/content/zotero/xpcom/file.js
@@ -83,10 +83,10 @@ Zotero.File = new function(){
/*
- * Get the first 128 bytes of the file as a string (multibyte-safe)
+ * Get the first 200 bytes of the file as a string (multibyte-safe)
*/
function getSample(file) {
- return this.getContents(file, null, 128);
+ return this.getContents(file, null, 200);
}
diff --git a/chrome/content/zotero/xpcom/mime.js b/chrome/content/zotero/xpcom/mime.js
@@ -233,7 +233,7 @@ Zotero.MIME = new function(){
}
}
// Otherwise allow match anywhere in sample
- // (128 bytes from getSample() by default)
+ // (200 bytes from getSample() by default)
else if (str.indexOf(_snifferEntries[i][0]) != -1) {
match = true;
}