1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-09-03 09:26:23 -07:00

Validate updated rank value

This commit is contained in:
Eggbertx 2025-02-25 22:55:25 -08:00
parent b2c5a2d737
commit 46a692767c

View file

@ -182,9 +182,13 @@ func staffCallback(writer http.ResponseWriter, request *http.Request, staff *gcs
Str("rank", rankStr).Send()
return "", err
}
if rank < 0 || rank > 3 {
errEv.Caller().Int("rank", rank).Send()
return "", errors.New("invalid rank")
}
}
var formMode formMode = noForm
var formMode = noForm
if staff.Rank == 3 {
if updateUsername == "" {
formMode = newUserForm