From 627c6f4fb042440ccf4a206cc78da164138ae91c Mon Sep 17 00:00:00 2001 From: jvoisin Date: Tue, 3 Nov 2015 15:53:54 +0100 Subject: Fix some mistakes found thanks to the previous commit --- libmat/office.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libmat') 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): """ Remove harmful metadata, by deleting everything that doesn't end with '.rels' in the 'docProps' folder. """ return super(OpenXmlStripper, self).remove_all( - beginning_blacklist='docProps/', whitelist='.rels') + beginning_blacklist=['docProps/'], whitelist=['.rels']) def is_clean(self): """ Check if the file is clean from harmful metadatas. @@ -91,7 +91,7 @@ class OpenXmlStripper(archive.TerminalZipStripper): if clean_super is False: return False - zipin = zipfile.ZipFile(self.filename, 'r') + zipin = zipfile.ZipFile(self.filename) for item in zipin.namelist(): if item.startswith('docProps/'): return False @@ -103,7 +103,7 @@ class OpenXmlStripper(archive.TerminalZipStripper): """ metadata = super(OpenXmlStripper, self).get_meta() - zipin = zipfile.ZipFile(self.filename, 'r') + zipin = zipfile.ZipFile(self.filename) for item in zipin.namelist(): if item.startswith('docProps/'): metadata[item] = 'harmful content' -- cgit v1.3