com web/master: that was almost what I've planned: github-webhook.php
| From: | Ferenc Kovacs | Date: | Tue, 10 Jun 2014 22:30:36 +0000 |
| Subject: | com web/master: that was almost what I've planned: github-webhook.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-19230@lists.php.net to get a copy of this message | ||
Commit: cbc4e41a44ae25fe258d02fa9332cfcac17535a6
Author: kovacs.ferenc <kovacs.ferenc@ustream.tv> Wed, 11 Jun 2014 00:30:36 +0200
Parents: 92e79aed063d8f6227e0e15f3fd68843792897fa
Branches: master
Link: http://git.php.net/?p=web/master.git;a=commitdiff;h=cbc4e41a44ae25fe258d02fa9332cfcac17535a6
Log:
that was almost what I've planned
Changed paths:
M github-webhook.php
Diff:
diff --git a/github-webhook.php b/github-webhook.php
index fb835bc..76e79db 100644
--- a/github-webhook.php
+++ b/github-webhook.php
@@ -7,9 +7,9 @@ $config = array(
),
);
-$description = file_get_contents("php://input");
+$body = file_get_contents("php://input");
-if (!verify_signature($description)) {
+if (!verify_signature($body)) {
header('HTTP/1.1 403 Forbidden');
exit;
}
@@ -18,7 +18,7 @@ switch ($_SERVER['HTTP_X_GITHUB_EVENT']) {
case 'ping':
break;
case 'pull_request':
- $payload = json_decode($description);
+ $payload = json_decode($body);
$action = $payload->action;
$PRNumber = $payload->number;
$PR = $payload->pull_request;