|
|
@ -2127,13 +2127,6 @@ func UpdateCommentContent(ctx *context.Context) {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if comment.Type == models.CommentTypeComment {
|
|
|
|
|
|
|
|
if err := comment.LoadAttachments(); err != nil {
|
|
|
|
|
|
|
|
ctx.ServerError("LoadAttachments", err)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if !ctx.IsSigned || (ctx.User.ID != comment.PosterID && !ctx.Repo.CanWriteIssuesOrPulls(comment.Issue.IsPull)) {
|
|
|
|
if !ctx.IsSigned || (ctx.User.ID != comment.PosterID && !ctx.Repo.CanWriteIssuesOrPulls(comment.Issue.IsPull)) {
|
|
|
|
ctx.Error(http.StatusForbidden)
|
|
|
|
ctx.Error(http.StatusForbidden)
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -2155,6 +2148,17 @@ func UpdateCommentContent(ctx *context.Context) {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ctx.FormBool("ignore_attachments") {
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if comment.Type == models.CommentTypeComment {
|
|
|
|
|
|
|
|
if err := comment.LoadAttachments(); err != nil {
|
|
|
|
|
|
|
|
ctx.ServerError("LoadAttachments", err)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if err := updateAttachments(comment, ctx.FormStrings("files[]")); err != nil {
|
|
|
|
if err := updateAttachments(comment, ctx.FormStrings("files[]")); err != nil {
|
|
|
|
ctx.ServerError("UpdateAttachments", err)
|
|
|
|
ctx.ServerError("UpdateAttachments", err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|