Also sanitize leading .
That way hidden files that are uploaded will be "de-hidden". Note that NO "de-hiding" of existing files will take place!
This commit is contained in:
parent
e8cac14c2f
commit
39372a9475
1 changed files with 5 additions and 1 deletions
|
|
@ -624,7 +624,11 @@ class LocalFileStorage(StorageInterface):
|
|||
if "/" in name or "\\" in name:
|
||||
raise ValueError("name must not contain / or \\")
|
||||
|
||||
return self._slugify(name).replace(" ", "_")
|
||||
result = self._slugify(name).replace(" ", "_")
|
||||
if result.startswith("."):
|
||||
# hidden files under *nix
|
||||
result = result[1:]
|
||||
return result
|
||||
|
||||
def sanitize_path(self, path):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue