diff options
Diffstat (limited to 'libmat2/office.py')
| -rw-r--r-- | libmat2/office.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/libmat2/office.py b/libmat2/office.py index 52bf7c5..62d3b05 100644 --- a/libmat2/office.py +++ b/libmat2/office.py | |||
| @@ -77,25 +77,26 @@ class MSOfficeParser(ZipParser): | |||
| 77 | self.files_to_keep = set(map(re.compile, { # type: ignore | 77 | self.files_to_keep = set(map(re.compile, { # type: ignore |
| 78 | r'^\[Content_Types\]\.xml$', | 78 | r'^\[Content_Types\]\.xml$', |
| 79 | r'^_rels/\.rels$', | 79 | r'^_rels/\.rels$', |
| 80 | r'^word/_rels/document\.xml\.rels$', | 80 | r'^(?:word|ppt)/_rels/document\.xml\.rels$', |
| 81 | r'^word/_rels/footer[0-9]*\.xml\.rels$', | 81 | r'^(?:word|ppt)/_rels/footer[0-9]*\.xml\.rels$', |
| 82 | r'^word/_rels/header[0-9]*\.xml\.rels$', | 82 | r'^(?:word|ppt)/_rels/header[0-9]*\.xml\.rels$', |
| 83 | r'^ppt/slideLayouts/_rels/slideLayout[0-9]+\.xml\.rels$', | ||
| 83 | 84 | ||
| 84 | # https://msdn.microsoft.com/en-us/library/dd908153(v=office.12).aspx | 85 | # https://msdn.microsoft.com/en-us/library/dd908153(v=office.12).aspx |
| 85 | r'^word/stylesWithEffects\.xml$', | 86 | r'^(?:word|ppt)/stylesWithEffects\.xml$', |
| 86 | })) | 87 | })) |
| 87 | self.files_to_omit = set(map(re.compile, { # type: ignore | 88 | self.files_to_omit = set(map(re.compile, { # type: ignore |
| 88 | r'^customXml/', | 89 | r'^customXml/', |
| 89 | r'webSettings\.xml$', | 90 | r'webSettings\.xml$', |
| 90 | r'^docProps/custom\.xml$', | 91 | r'^docProps/custom\.xml$', |
| 91 | r'^word/printerSettings/', | 92 | r'^(?:word|ppt)/printerSettings/', |
| 92 | r'^word/theme', | 93 | r'^(?:word|ppt)/theme', |
| 93 | r'^word/people\.xml$', | 94 | r'^(?:word|ppt)/people\.xml$', |
| 94 | r'^word/numbering\.xml$', | 95 | r'^(?:word|ppt)/numbering\.xml$', |
| 95 | 96 | ||
| 96 | # we have an allowlist in self.files_to_keep, | 97 | # we have an allowlist in self.files_to_keep, |
| 97 | # so we can trash everything else | 98 | # so we can trash everything else |
| 98 | r'^word/_rels/', | 99 | r'^(?:word|ppt)/_rels/', |
| 99 | })) | 100 | })) |
| 100 | 101 | ||
| 101 | if self.__fill_files_to_keep_via_content_types() is False: | 102 | if self.__fill_files_to_keep_via_content_types() is False: |
