diff options
author | 6543 <6543@obermui.de> | 2021-08-11 17:08:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-11 18:08:52 +0300 |
commit | f1a810e0901b80eb6bc21103434fc0737af17eaa (patch) | |
tree | 9656d780cf19fd745f41eef0012701458aa271c4 /routers/web/repo/issue.go | |
parent | 2d25b7d44bedf8f17cc2b49f39d1cee662b199a5 (diff) | |
download | gitea-f1a810e0901b80eb6bc21103434fc0737af17eaa.tar.gz gitea-f1a810e0901b80eb6bc21103434fc0737af17eaa.zip |
Related refactors to ctx.FormX functions (#16567)
* use FormTrim if posible
* speedup goGet
* only convert if nessesary
Diffstat (limited to 'routers/web/repo/issue.go')
-rw-r--r-- | routers/web/repo/issue.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 248ae5b132..6050bb5c23 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -1722,14 +1722,12 @@ func UpdateIssueContent(ctx *context.Context) { return } - content := ctx.FormString("content") - if err := issue_service.ChangeContent(issue, ctx.User, content); err != nil { + if err := issue_service.ChangeContent(issue, ctx.User, ctx.Req.FormValue("content")); err != nil { ctx.ServerError("ChangeContent", err) return } - files := ctx.FormStrings("files[]") - if err := updateAttachments(issue, files); err != nil { + if err := updateAttachments(issue, ctx.FormStrings("files[]")); err != nil { ctx.ServerError("UpdateAttachments", err) return } @@ -2157,8 +2155,7 @@ func UpdateCommentContent(ctx *context.Context) { return } - files := ctx.FormStrings("files[]") - if err := updateAttachments(comment, files); err != nil { + if err := updateAttachments(comment, ctx.FormStrings("files[]")); err != nil { ctx.ServerError("UpdateAttachments", err) return } |