fix: fix import uploads (#1173)

* Fixes issue with importing backups that contain invalid empty directories
bulk-clear-sessions
fengkx 2020-01-04 12:56:12 +08:00 committed by Kevin Chung
parent 5b65a6ced0
commit 7ff6163309
1 changed files with 1 additions and 1 deletions

View File

@ -304,7 +304,7 @@ def import_ctf(backup, erase=True):
for f in files:
filename = f.split(os.sep, 1)
if len(filename) < 2: # just an empty uploads directory (e.g. uploads/)
if len(filename) < 2 or os.path.basename(filename[1]) == '': # just an empty uploads directory (e.g. uploads/) or any directory
continue
filename = filename[1] # Get the second entry in the list (the actual filename)