From 5ef4992fd777f4b0b1a647ee5a739eb95e37b016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Sun, 12 Nov 2023 18:45:40 +0100 Subject: [PATCH] fix GET /{username}/{reponame}/{type:issues|pulls}/{index}/content-history/detail (cherry picked from commit 0853dec293dd632a03948f66af69e75dd582a92d) --- routers/web/repo/issue_content_history.go | 4 ++++ 1 file changed, 4 insertions(+) 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