aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/issue_pin.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-12-11 03:37:10 +0800
committerGitHub <noreply@github.com>2023-12-10 21:37:10 +0200
commit9a99c17a1412fce29944bd9a87d7dc6d40423c77 (patch)
tree6b005d47df7a169d267622abc55ef95841f977f6 /routers/web/repo/issue_pin.go
parentaeb383025f90abcda7a9562684376b1996dcf3a5 (diff)
downloadgitea-9a99c17a1412fce29944bd9a87d7dc6d40423c77.tar.gz
gitea-9a99c17a1412fce29944bd9a87d7dc6d40423c77.zip
Fix missing check (#28406)
Diffstat (limited to 'routers/web/repo/issue_pin.go')
-rw-r--r--routers/web/repo/issue_pin.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/web/repo/issue_pin.go b/routers/web/repo/issue_pin.go
index f853f72335..9f334129f9 100644
--- a/routers/web/repo/issue_pin.go
+++ b/routers/web/repo/issue_pin.go
@@ -90,6 +90,12 @@ func IssuePinMove(ctx *context.Context) {
return
}
+ if issue.RepoID != ctx.Repo.Repository.ID {
+ ctx.Status(http.StatusNotFound)
+ log.Error("Issue does not belong to this repository")
+ return
+ }
+
err = issue.MovePin(ctx, form.Position)
if err != nil {
ctx.Status(http.StatusInternalServerError)