Commit:    17134ef267302ca9605d72ad804259a48366a7d3
Author:    kovacs.ferenc <kovacs.fer...@ustream.tv>         Fri, 1 Aug 2014 
15:27:52 +0200
Parents:   f006fcfc79247fa060e6e72b5f35b68c3ebb6093
Branches:  master

Link:       
http://git.php.net/?p=web/master.git;a=commitdiff;h=17134ef267302ca9605d72ad804259a48366a7d3

Log:
make sure that the variables used below are properly initialized

Changed paths:
  M  github-webhook.php


Diff:
diff --git a/github-webhook.php b/github-webhook.php
index 7b7391d..3d2e77a 100644
--- a/github-webhook.php
+++ b/github-webhook.php
@@ -50,16 +50,18 @@ if (!verify_signature($body)) {
        exit;
 }
 
+$PR = $payload->pull_request;
+$action = $payload->action;
+$payload = json_decode($body);
+$htmlUrl = $PR->html_url;
+$repoName = $PR->base->repo->name;
+$description = $PR->body;
+
 switch  ($_SERVER['HTTP_X_GITHUB_EVENT']) {
        case 'ping':
                break;
        case 'pull_request':
-               $payload = json_decode($body);
-               $action = $payload->action;
-               $PR = $payload->pull_request;
                $mergeable = $PR->mergeable;
-        $htmlUrl = $PR->html_url;
-        $description = $PR->body;
 
         $to = get_repo_email($CONFIG["repos"], $repoName);
         $subject = prep_title($action, $PR, $PR->base);
@@ -74,9 +76,6 @@ switch  ($_SERVER['HTTP_X_GITHUB_EVENT']) {
                break;
 
     case 'pull_request_review_comment':
-               $payload = json_decode($body);
-               $action = $payload->action;
-               $PR = $payload->pull_request;
         $username = $payload->user->login;
                $comment = $payload->comment->body;


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to