diff --git a/src/matchers/doc.rs b/src/matchers/doc.rs index 71c3a03..ee64ac7 100644 --- a/src/matchers/doc.rs +++ b/src/matchers/doc.rs @@ -84,7 +84,6 @@ fn msooxml(buf: &[u8]) -> Option { // 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; @@ -94,6 +93,13 @@ fn msooxml(buf: &[u8]) -> Option { 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;