aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/api_helpers.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-05 17:31:50 -0400
committerhistoria <[not public]>2026-10-05 17:31:50 -0400
commit516fd29da423432ef6dfded21a984f1d15dcab1a (patch)
treeeb2dabe325a1335dedac28a93453df643ef986f2 /internal/admin/api_helpers.go
parente42952469dadfb3535633c66c881050ac128703c (diff)
downloadthehouseoficarus-516fd29da423432ef6dfded21a984f1d15dcab1a.tar.gz
fix: slop casino and economy fixes
Diffstat (limited to 'internal/admin/api_helpers.go')
-rw-r--r--internal/admin/api_helpers.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/admin/api_helpers.go b/internal/admin/api_helpers.go
index 37cc4ae..d5e23c3 100644
--- a/internal/admin/api_helpers.go
+++ b/internal/admin/api_helpers.go
@@ -17,12 +17,17 @@ import (
// JSON bodies, so an unchecked join could otherwise escape the data
// directory ("../") or touch dot files.
func validEntityID(id string) bool {
- if id == "" || id == "." || id == ".." {
+ if id == "" || id == "." || id == ".." || strings.HasPrefix(id, ".") {
return false
}
if strings.ContainsAny(id, `/\`) || strings.ContainsRune(id, 0) {
return false
}
+ for _, r := range id {
+ if r < 32 || r == 127 {
+ return false
+ }
+ }
return true
}