소스 검색

Duplicate code: Use is_safe_path_component

Unrud 9 년 전
부모
커밋
a4a6a62643
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      radicale/storage.py

+ 1 - 1
radicale/storage.py

@@ -125,7 +125,7 @@ def sanitize_path(path):
     path = posixpath.normpath(path)
     new_path = "/"
     for part in path.split("/"):
-        if not part or part in (".", ".."):
+        if not is_safe_path_component(part):
             continue
         new_path = posixpath.join(new_path, part)
     trailing_slash = "" if new_path.endswith("/") else trailing_slash