mirror of
https://github.com/zotero/zotero.git
synced 2026-10-07 02:58:09 +00:00
Fix PDF magic number sniffing matching anywhere in first 200 bytes
The %PDF- sniffer entry had no offset constraint, so it matched anywhere in the file sample. This could cause ZIP files containing PDFs to be misidentified as application/pdf when opened, since %PDF- could appear within the first 200 bytes of the archive. Pin the match to offset 0, where it must appear in a valid PDF. Fixes https://forums.zotero.org/discussion/130161/zip-files-and-indexing
This commit is contained in:
parent
81f80a62e3
commit
e60bf91e31
1 changed files with 1 additions and 1 deletions
|
|
@ -31,7 +31,7 @@ Zotero.MIME = new function () {
|
|||
|
||||
// Magic numbers -- see https://en.wikipedia.org/wiki/List_of_file_signatures
|
||||
var _snifferEntries = [
|
||||
["%PDF-", "application/pdf"],
|
||||
["%PDF-", "application/pdf", 0],
|
||||
["%!PS-Adobe-", 'application/postscript', 0],
|
||||
["%! PS-Adobe-", 'application/postscript', 0],
|
||||
["From", 'text/plain', 0],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue