Skip to content

Commit

Permalink
add check for spaces in validate zip (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
samwinebrake authored Feb 12, 2024
1 parent 7f1cd5f commit 4eb311f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions benchmarks/views/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,12 @@ def is_submission_original(file, submitter: User) -> Tuple[bool, Union[None, Lis
def validate_zip(file):
with zipfile.ZipFile(file, mode="r") as archive:
namelist = archive.infolist()

# Check for spaces in file names
for item in namelist:
if ' ' in item.filename:
return False, f"File '{item.filename}' contains spaces. Please remove spaces from all file names."

root = namelist[0]
has_plugin, submitted_plugins = plugins_exist(namelist)
if not has_plugin:
Expand Down

0 comments on commit 4eb311f

Please sign in to comment.