com web/master: duh, swap the lines so $payload is set before used: github-webhook.php
| From: | Ferenc Kovacs | Date: | Fri, 01 Aug 2014 14:25:01 +0000 |
| Subject: | com web/master: duh, swap the lines so $payload is set before used: github-webhook.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-19603@lists.php.net to get a copy of this message | ||
Commit: b1aecf8e1944b17de14d52d2e2c9ce989a2a3eaa
Author: kovacs.ferenc <kovacs.ferenc@ustream.tv> Fri, 1 Aug 2014 16:25:01 +0200
Parents: 17134ef267302ca9605d72ad804259a48366a7d3
Branches: master
Link: http://git.php.net/?p=web/master.git;a=commitdiff;h=b1aecf8e1944b17de14d52d2e2c9ce989a2a3eaa
Log:
duh, swap the lines so $payload is set before used
Changed paths:
M github-webhook.php
Diff:
diff --git a/github-webhook.php b/github-webhook.php
index 3d2e77a..b717c1d 100644
--- a/github-webhook.php
+++ b/github-webhook.php
@@ -50,9 +50,9 @@ if (!verify_signature($body)) {
exit;
}
+$payload = json_decode($body);
$PR = $payload->pull_request;
$action = $payload->action;
-$payload = json_decode($body);
$htmlUrl = $PR->html_url;
$repoName = $PR->base->repo->name;
$description = $PR->body;