diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-03-08 10:51:01 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-03-08 10:51:01 +0900 |
| commit | c06d46eae30c9468535fb6af5e9b822acadbbdb6 (patch) | |
| tree | c4c740f0cccd15f825596f7a115f3b8f8eb8ffa7 /backend | |
| parent | 32344d99c473b634c37f5d11e52ef389d46d4510 (diff) | |
| download | iosdc-japan-2025-albatross-c06d46eae30c9468535fb6af5e9b822acadbbdb6.tar.gz iosdc-japan-2025-albatross-c06d46eae30c9468535fb6af5e9b822acadbbdb6.tar.zst iosdc-japan-2025-albatross-c06d46eae30c9468535fb6af5e9b822acadbbdb6.zip | |
trim php tag before execution
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/game/hub.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/game/hub.go b/backend/game/hub.go index 0aca96c..46cd321 100644 --- a/backend/game/hub.go +++ b/backend/game/hub.go @@ -38,7 +38,7 @@ func (hub *Hub) Run() { func (hub *Hub) CalcCodeSize(code string) int { re := regexp.MustCompile(`\s+`) - return len(re.ReplaceAllString(code, "")) + return len(strings.TrimSuffix(strings.TrimPrefix(strings.TrimPrefix(re.ReplaceAllString(code, ""), "<?php"), "<?"), "?>")) } func (hub *Hub) EnqueueTestTasks(ctx context.Context, submissionID, gameID, userID int, code string) error { |
