summaryrefslogtreecommitdiff
path: root/libmat/office.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmat/office.py')
-rw-r--r--libmat/office.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/libmat/office.py b/libmat/office.py
index 5a57b57..00b8f34 100644
--- a/libmat/office.py
+++ b/libmat/office.py
@@ -80,7 +80,7 @@ class OpenXmlStripper(archive.TerminalZipStripper):
80 """ Remove harmful metadata, by deleting everything that doesn't end with '.rels' in the 80 """ Remove harmful metadata, by deleting everything that doesn't end with '.rels' in the
81 'docProps' folder. """ 81 'docProps' folder. """
82 return super(OpenXmlStripper, self).remove_all( 82 return super(OpenXmlStripper, self).remove_all(
83 beginning_blacklist='docProps/', whitelist='.rels') 83 beginning_blacklist=['docProps/'], whitelist=['.rels'])
84 84
85 def is_clean(self): 85 def is_clean(self):
86 """ Check if the file is clean from harmful metadatas. 86 """ Check if the file is clean from harmful metadatas.
@@ -91,7 +91,7 @@ class OpenXmlStripper(archive.TerminalZipStripper):
91 if clean_super is False: 91 if clean_super is False:
92 return False 92 return False
93 93
94 zipin = zipfile.ZipFile(self.filename, 'r') 94 zipin = zipfile.ZipFile(self.filename)
95 for item in zipin.namelist(): 95 for item in zipin.namelist():
96 if item.startswith('docProps/'): 96 if item.startswith('docProps/'):
97 return False 97 return False
@@ -103,7 +103,7 @@ class OpenXmlStripper(archive.TerminalZipStripper):
103 """ 103 """
104 metadata = super(OpenXmlStripper, self).get_meta() 104 metadata = super(OpenXmlStripper, self).get_meta()
105 105
106 zipin = zipfile.ZipFile(self.filename, 'r') 106 zipin = zipfile.ZipFile(self.filename)
107 for item in zipin.namelist(): 107 for item in zipin.namelist():
108 if item.startswith('docProps/'): 108 if item.startswith('docProps/'):
109 metadata[item] = 'harmful content' 109 metadata[item] = 'harmful content'