From c872d0275846eaeeae02e033b2873f4159e9162a Mon Sep 17 00:00:00 2001 From: undefined Date: Thu, 18 Aug 2022 20:17:43 +0800 Subject: [PATCH] core: only extract zip for testdata --- packages/hydrooj/package.json | 2 +- packages/hydrooj/src/handler/problem.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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) {