Explorar o código

Duplicate code: Use is_safe_path_component

Unrud %!s(int64=9) %!d(string=hai) anos
pai
achega
a4a6a62643
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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