Browse Source

add more input validation to getFolderJSON()

master
cinnaboot 7 years ago
parent
commit
09b2097b57
  1. 4
      video_metadata/views/file_listing.py

4
video_metadata/views/file_listing.py

@ -74,7 +74,9 @@ def getFolderJSON(subpath = ''):
# validate input
if re.search('\.\.', subpath) or not os.path.exists(full_path):
errors.append('invalid path?: {}'.format(full_path))
errors.append('invalid path: {}'.format(full_path))
elif not os.path.isdir(full_path):
errors.append('path is not a directory: {}'.format(full_path))
else:
for entry in os.scandir(full_path):
# TODO: remove 'getPathInfo()' when finished with async file listing

Loading…
Cancel
Save