mirror of https://github.com/sc0tfree/updog.git
Add blank path validation. Close #2.
This commit is contained in:
parent
5566289daf
commit
39d544a932
|
@ -129,7 +129,7 @@ def main():
|
||||||
|
|
||||||
path = request.form['path']
|
path = request.form['path']
|
||||||
# Prevent file upload to paths outside of base directory
|
# Prevent file upload to paths outside of base directory
|
||||||
if not is_valid_subpath(path, base_directory):
|
if not is_valid_subpath(path, base_directory) or path == '':
|
||||||
return redirect(request.referrer)
|
return redirect(request.referrer)
|
||||||
|
|
||||||
for file in request.files.getlist('file'):
|
for file in request.files.getlist('file'):
|
||||||
|
|
Loading…
Reference in New Issue