Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/matchers/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ fn msooxml(buf: &[u8]) -> Option<DocType> {
// file we have. Correct the mimetype with the registered ones:
// http://technet.microsoft.com/en-us/library/cc179224.aspx
start_offset += idx + 4 + 26;
check_msooml(buf, start_offset)?;

// OpenOffice/Libreoffice orders ZIP entry differently, so check the 4th file
start_offset += 26;
Expand All @@ -94,6 +93,13 @@ fn msooxml(buf: &[u8]) -> Option<DocType> {
None => return Some(DocType::OOXML),
};

// Check the 5th file, for Numbers and Apache POI sources
let idx = search(buf, start_offset, 6000);
match idx {
Some(idx) => start_offset += idx + 4 + 26,
None => return Some(DocType::OOXML),
};

let typo = check_msooml(buf, start_offset);
if typo.is_some() {
return typo;
Expand Down