mrjoes/flask-admin — pull request #36 by SalemHarrache (2012-07-22 10:34:15+00:00)
Title: Avoid 404 error with FileAdmin

an error occurs when you use '.' and '..' in your `base_path`:

>>> 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