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:
Gina Häußge 2016-08-15 14:15:13 +02:00
parent e8cac14c2f
commit 39372a9475

View file

@ -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):
"""