mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-10 18:40:53 +00:00
Duplicate code: Use is_safe_path_component
This commit is contained in:
parent
8d5f2ded42
commit
a4a6a62643
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue