diff options
author | FChannel <> | 2022-07-16 08:27:23 -0700 |
---|---|---|
committer | FChannel <> | 2022-07-16 08:27:23 -0700 |
commit | 6de8273150a2d8314c8c9535e4c7259602ce8047 (patch) | |
tree | 6c0f96d2bb0e80fae2baf2d3fbc7b16b1aa67578 /route/routes | |
parent | 65553482ceb3c61122e809128b66e9ee50d94891 (diff) |
increased comment limit check if inReplyTo is NaN, check if from.Value nil
Diffstat (limited to 'route/routes')
-rw-r--r-- | route/routes/actor.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/route/routes/actor.go b/route/routes/actor.go index 7cc11ae..4df801e 100644 --- a/route/routes/actor.go +++ b/route/routes/actor.go @@ -3,6 +3,7 @@ package routes import ( "bytes" "encoding/json" + "errors" "io" "io/ioutil" "mime/multipart" @@ -231,9 +232,9 @@ func MakeActorPost(ctx *fiber.Ctx) error { } } - if len(ctx.FormValue("comment")) > 2000 { + if len(ctx.FormValue("comment")) > 4500 { return ctx.Render("403", fiber.Map{ - "message": "Comment limit 2000 characters", + "message": "Comment limit 4500 characters", }) } @@ -277,6 +278,10 @@ func MakeActorPost(ctx *fiber.Ctx) error { form, _ := ctx.MultipartForm() + if form.Value == nil { + return util.MakeError(errors.New("form value nil"), "ActorPost") + } + for key, r0 := range form.Value { if key == "captcha" { err := we.WriteField(key, ctx.FormValue("captchaCode")+":"+ctx.FormValue("captcha")) @@ -303,7 +308,7 @@ func MakeActorPost(ctx *fiber.Ctx) error { } } - if ctx.FormValue("inReplyTo") == "" && reply != "" { + if (ctx.FormValue("inReplyTo") == "" || ctx.FormValue("inReplyTo") == "NaN") && reply != "" { err := we.WriteField("inReplyTo", reply) if err != nil { return util.MakeError(err, "ActorPost") |