From 60110adc06ef85e533f48a52a744d43c63a818bc Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sun, 17 Jul 2016 08:33:59 +0800 Subject: models/webhook: restrict deletion to be explicitly with repo and org ID --- routers/repo/webhook.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'routers/repo') diff --git a/routers/repo/webhook.go b/routers/repo/webhook.go index b2274033b0..22d5cfd2c6 100644 --- a/routers/repo/webhook.go +++ b/routers/repo/webhook.go @@ -384,8 +384,8 @@ func TestWebhook(ctx *context.Context) { } func DeleteWebhook(ctx *context.Context) { - if err := models.DeleteWebhook(ctx.QueryInt64("id")); err != nil { - ctx.Flash.Error("DeleteWebhook: " + err.Error()) + if err := models.DeleteWebhookByRepoID(ctx.Repo.Repository.ID, ctx.QueryInt64("id")); err != nil { + ctx.Flash.Error("DeleteWebhookByRepoID: " + err.Error()) } else { ctx.Flash.Success(ctx.Tr("repo.settings.webhook_deletion_success")) } -- cgit v1.2.3