diff --git a/routers/web/repo/issue_content_history.go b/routers/web/repo/issue_content_history.go index 23255e774f..bc0945c9d1 100644 --- a/routers/web/repo/issue_content_history.go +++ b/routers/web/repo/issue_content_history.go @@ -125,6 +125,10 @@ func GetContentHistoryDetail(ctx *context.Context) { }) return } + if history.IssueID != issue.ID { + ctx.NotFound("CompareRepoID", issues_model.ErrCommentNotExist{}) + return + } // get the related comment if this history revision is for a comment, otherwise the history revision is for an issue. var comment *issues_model.Comment