fix POST /{owner}/{repo}/comments/{id}

(cherry picked from commit 385a1f337462bec34ccc389d4efe21e3b2be8465)
This commit is contained in:
Loïc Dachary 2023-11-02 17:00:30 +01:00
parent 0d7893ca8a
commit 5cc6361e31
No known key found for this signature in database
GPG key ID: 992D23B392F9E4F2

View file

@ -2971,6 +2971,11 @@ func UpdateCommentContent(ctx *context.Context) {
return
}
if comment.Issue.RepoID != ctx.Repo.Repository.ID {
ctx.NotFound("CompareRepoID", issues_model.ErrCommentNotExist{})
return
}
if !ctx.IsSigned || (ctx.Doer.ID != comment.PosterID && !ctx.Repo.CanWriteIssuesOrPulls(comment.Issue.IsPull)) {
ctx.Error(http.StatusForbidden)
return