Validate filename

pull/62/head
Thomas Bouve 2021-09-07 01:15:52 +02:00
rodzic b2dd8d6cc3
commit 704db46542
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -122,6 +122,8 @@ def is_valid_filename(filename: str) -> bool:
return (
not filename.startswith('/') and
not filename.startswith('\\') and
not filename.endswith('/') and
not filename.endswith('\\') and
'../' not in filename and
'..\\' not in filename
)
)