summaryrefslogtreecommitdiff
path: root/libmat2/office.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmat2/office.py')
-rw-r--r--libmat2/office.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/libmat2/office.py b/libmat2/office.py
index f3a5b22..2c9cbff 100644
--- a/libmat2/office.py
+++ b/libmat2/office.py
@@ -89,7 +89,7 @@ class MSOfficeParser(ArchiveBasedAbstractParser):
89 r'^word/theme', 89 r'^word/theme',
90 r'^word/people\.xml$', 90 r'^word/people\.xml$',
91 91
92 # we have a whitelist in self.files_to_keep, 92 # we have an allowlist in self.files_to_keep,
93 # so we can trash everything else 93 # so we can trash everything else
94 r'^word/_rels/', 94 r'^word/_rels/',
95 })) 95 }))
@@ -100,7 +100,7 @@ class MSOfficeParser(ArchiveBasedAbstractParser):
100 def __fill_files_to_keep_via_content_types(self) -> bool: 100 def __fill_files_to_keep_via_content_types(self) -> bool:
101 """ There is a suer-handy `[Content_Types].xml` file 101 """ There is a suer-handy `[Content_Types].xml` file
102 in MS Office archives, describing what each other file contains. 102 in MS Office archives, describing what each other file contains.
103 The self.content_types_to_keep member contains a type whitelist, 103 The self.content_types_to_keep member contains a type allowlist,
104 so we're using it to fill the self.files_to_keep one. 104 so we're using it to fill the self.files_to_keep one.
105 """ 105 """
106 with zipfile.ZipFile(self.filename) as zin: 106 with zipfile.ZipFile(self.filename) as zin:
@@ -220,7 +220,7 @@ class MSOfficeParser(ArchiveBasedAbstractParser):
220 for file_to_omit in self.files_to_omit: 220 for file_to_omit in self.files_to_omit:
221 if file_to_omit.search(fname): 221 if file_to_omit.search(fname):
222 matches = map(lambda r: r.search(fname), self.files_to_keep) 222 matches = map(lambda r: r.search(fname), self.files_to_keep)
223 if any(matches): # the file is whitelisted 223 if any(matches): # the file is in the allowlist
224 continue 224 continue
225 removed_fnames.add(fname) 225 removed_fnames.add(fname)
226 break 226 break