diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-06-21 12:19:06 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-06-21 12:19:06 -0400 |
commit | d7a8160c2b422dcf950093d9d17d90f1e80201de (patch) | |
tree | 51ad4b6bd086e178406ec2b6c5b29699f7917cf7 /app/Controller/Webhook.php | |
parent | 98fd34bfe340fae6d0fd3b7333b6f9a6647cbae2 (diff) |
Update Bitbucket webhooks to handle issues/commit/comments
Diffstat (limited to 'app/Controller/Webhook.php')
-rw-r--r-- | app/Controller/Webhook.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/Controller/Webhook.php b/app/Controller/Webhook.php index d04f83b3..1a4cfe9a 100644 --- a/app/Controller/Webhook.php +++ b/app/Controller/Webhook.php @@ -53,7 +53,7 @@ class Webhook extends Base $result = $this->githubWebhook->parsePayload( $this->request->getHeader('X-Github-Event'), - $this->request->getJson() ?: array() + $this->request->getJson() ); echo $result ? 'PARSED' : 'IGNORED'; @@ -69,7 +69,7 @@ class Webhook extends Base $this->checkWebhookToken(); $this->gitlabWebhook->setProjectId($this->request->getIntegerParam('project_id')); - $result = $this->gitlabWebhook->parsePayload($this->request->getJson() ?: array()); + $result = $this->gitlabWebhook->parsePayload($this->request->getJson()); echo $result ? 'PARSED' : 'IGNORED'; } @@ -84,7 +84,11 @@ class Webhook extends Base $this->checkWebhookToken(); $this->bitbucketWebhook->setProjectId($this->request->getIntegerParam('project_id')); - $result = $this->bitbucketWebhook->parsePayload(json_decode(@$_POST['payload'], true) ?: array()); + + $result = $this->bitbucketWebhook->parsePayload( + $this->request->getHeader('X-Event-Key'), + $this->request->getJson() + ); echo $result ? 'PARSED' : 'IGNORED'; } @@ -97,7 +101,7 @@ class Webhook extends Base public function postmark() { $this->checkWebhookToken(); - echo $this->postmark->receiveEmail($this->request->getJson() ?: array()) ? 'PARSED' : 'IGNORED'; + echo $this->postmark->receiveEmail($this->request->getJson()) ? 'PARSED' : 'IGNORED'; } /** |