diff --git a/packages/hydrooj/package.json b/packages/hydrooj/package.json index 08e6ed169..6bfd813e5 100644 --- a/packages/hydrooj/package.json +++ b/packages/hydrooj/package.json @@ -1,6 +1,6 @@ { "name": "hydrooj", - "version": "3.15.15", + "version": "3.15.16", "bin": "bin/hydrooj.js", "main": "src/loader", "module": "src/loader", diff --git a/packages/hydrooj/src/handler/problem.ts b/packages/hydrooj/src/handler/problem.ts index 6ad636d50..b8bfafa56 100644 --- a/packages/hydrooj/src/handler/problem.ts +++ b/packages/hydrooj/src/handler/problem.ts @@ -652,7 +652,7 @@ export class ProblemFilesHandler extends ProblemDetailHandler { if (filename.includes('/') || filename.includes('..')) throw new ValidationError('filename', null, 'Bad filename'); if (!this.user.own(this.pdoc, PERM.PERM_EDIT_PROBLEM_SELF)) this.checkPerm(PERM.PERM_EDIT_PROBLEM); const files = []; - if (filename.endsWith('.zip')) { + if (filename.endsWith('.zip') && type === 'testdata') { const zip = new AdmZip(this.request.files.file.filepath); const entries = zip.getEntries(); for (const entry of entries) {