Python tool for converting files and office documents to Markdown.
Run pre-commit
gagb5fc70864f23c
diff --git a/src/markitdown/_markitdown.py b/src/markitdown/_markitdown.pyindex 28770f40..040a586e 100644--- a/src/markitdown/_markitdown.py+++ b/src/markitdown/_markitdown.py@@ -1144,9 +1144,14 @@ class ZipConverter(DocumentConverter):# Safeguard against path traversalfor member in zipObj.namelist():member_path = os.path.normpath(os.path.join(extraction_dir, member))- if not os.path.commonprefix([extraction_dir, member_path]) == extraction_dir:- raise ValueError(f"Path traversal detected in zip file: {member}")-+ if (+ not os.path.commonprefix([extraction_dir, member_path])+ == extraction_dir+ ):+ raise ValueError(+ f"Path traversal detected in zip file: {member}"+ )+# Extract all files safelyzipObj.extractall(path=extraction_dir)