Skip to content

Commit ab5677a

Browse files
committed
fix(bug): cannot use [GUID] in flag template
1 parent 1215995 commit ab5677a

File tree

4 files changed

+101
-87
lines changed

4 files changed

+101
-87
lines changed

src/GZCTF/ClientApp/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@mdi/react": "^1.6.1",
2626
"@microsoft/signalr": "^7.0.9",
2727
"dayjs": "^1.11.9",
28-
"echarts": "^5.4.2",
28+
"echarts": "^5.4.3",
2929
"echarts-for-react": "^3.0.2",
3030
"embla-carousel": "^7.1.0",
3131
"embla-carousel-autoplay": "^7.1.0",
@@ -38,8 +38,8 @@
3838
"react": "^18.2.0",
3939
"react-dom": "^18.2.0",
4040
"react-pdf": "^7.1.3",
41-
"react-router": "^6.14.1",
42-
"react-router-dom": "^6.14.1",
41+
"react-router": "^6.14.2",
42+
"react-router-dom": "^6.14.2",
4343
"swr": "^2.2.0",
4444
"vite-tsconfig-paths": "^4.2.0"
4545
},
@@ -53,8 +53,8 @@
5353
"@types/prismjs": "^1.26.0",
5454
"@types/react": "^18.2.15",
5555
"@types/react-dom": "^18.2.7",
56-
"@typescript-eslint/eslint-plugin": "^6.0.0",
57-
"@typescript-eslint/parser": "^6.0.0",
56+
"@typescript-eslint/eslint-plugin": "^6.1.0",
57+
"@typescript-eslint/parser": "^6.1.0",
5858
"@vitejs/plugin-react": "^4.0.3",
5959
"axios": "^1.4.0",
6060
"babel-plugin-prismjs": "^2.1.0",
@@ -63,7 +63,7 @@
6363
"form-data": "~4.0.0",
6464
"lodash": "^4.17.21",
6565
"prettier": "~3.0.0",
66-
"rollup": "^3.26.2",
66+
"rollup": "^3.26.3",
6767
"swagger-typescript-api": "^13.0.0",
6868
"tslib": "^2.6.0",
6969
"typescript": "5.1.6",

src/GZCTF/ClientApp/pnpm-lock.yaml

+67-73
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GZCTF/Controllers/EditController.cs

+3-8
Original file line numberDiff line numberDiff line change
@@ -517,14 +517,9 @@ public async Task<IActionResult> UpdateGameChallenge([FromRoute] int id, [FromRo
517517
if (model.FileName is not null && string.IsNullOrWhiteSpace(model.FileName))
518518
return BadRequest(new RequestResponse("动态附件名不可为空"));
519519

520-
bool hintUpdated = model.Hints is not null &&
521-
model.Hints.Count > 0 &&
522-
model.Hints.GetSetHashCode() != res.Hints?.GetSetHashCode();
523-
524-
if (!string.IsNullOrWhiteSpace(model.FlagTemplate)
525-
&& res.Type == ChallengeType.DynamicContainer
526-
&& !model.FlagTemplate.Contains("[TEAM_HASH]")
527-
&& Codec.Leet.LeetEntropy(model.FlagTemplate) < 32.0)
520+
bool hintUpdated = model.IsHintUpdated(res.Hints?.GetSetHashCode());
521+
522+
if (res.Type == ChallengeType.DynamicContainer && !model.IsValidFlagTemplate())
528523
return BadRequest(new RequestResponse("flag 复杂度不足,请考虑添加队伍哈希或增加长度"));
529524

530525
res.Update(model);

0 commit comments

Comments
 (0)