diff options
| author | jvoisin | 2015-11-03 15:53:54 +0100 |
|---|---|---|
| committer | jvoisin | 2015-11-03 15:53:54 +0100 |
| commit | 627c6f4fb042440ccf4a206cc78da164138ae91c (patch) | |
| tree | 9f03ea87fbe497e5132ccecc83a8cfbbefcc9cd2 /libmat/office.py | |
| parent | ba615c268f14bd2519dc61746cfa151ce730ec76 (diff) | |
Fix some mistakes found thanks to the previous commit
Diffstat (limited to '')
| -rw-r--r-- | libmat/office.py | 6 |
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' |
