Commit 8b6b380b authored by Salem Harrache's avatar Salem Harrache

Use normalpath() with base_path to avoid abort(404).

e.g:
>>> op.normpath(directory).startswith(base_path)
False
>>> op.normpath(directory)
u'/home/projects/mywebsite/static/utils'
>>> base_path
u'/home/projects/mywebsite/admin/../static'
>>> base_path = op.normpath(base_path)
>>> op.normpath(directory).startswith(base_path)
True
parent 87599455
...@@ -176,7 +176,7 @@ class FileAdmin(BaseView): ...@@ -176,7 +176,7 @@ class FileAdmin(BaseView):
Return base path. Override to customize behavior (per-user Return base path. Override to customize behavior (per-user
directories, etc) directories, etc)
""" """
return self.base_path return op.normpath(self.base_path)
def get_base_url(self): def get_base_url(self):
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment