Allow some paths to contain .. but not ../

This commit is contained in:
Ivanq 2019-07-01 18:17:42 +03:00
parent 822dec5c03
commit 743f92d15e
2 changed files with 3 additions and 3 deletions

View file

@ -382,7 +382,7 @@ class SiteStorage(object):
if not inner_path:
return self.directory
if ".." in inner_path:
if "../" in inner_path:
raise Exception("File not allowed: %s" % inner_path)
return "%s/%s" % (self.directory, inner_path)