mirror of https://github.com/JohnHammond/CTFd.git
fix: fix import uploads (#1173)
* Fixes issue with importing backups that contain invalid empty directoriesbulk-clear-sessions
parent
5b65a6ced0
commit
7ff6163309
|
@ -304,7 +304,7 @@ def import_ctf(backup, erase=True):
|
||||||
for f in files:
|
for f in files:
|
||||||
filename = f.split(os.sep, 1)
|
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
|
continue
|
||||||
|
|
||||||
filename = filename[1] # Get the second entry in the list (the actual filename)
|
filename = filename[1] # Get the second entry in the list (the actual filename)
|
||||||
|
|
Loading…
Reference in New Issue