Commit:    239016adc19a96b60d26bb0442cfd167a0776b18
Author:    Johannes Schlüter <johan...@schlueters.de>         Tue, 7 May 2013 
18:38:06 +0200
Parents:   f661d7805629af8da85e35fb8bcf740cd58eabfd
Branches:  master

Link:       
http://git.php.net/?p=web/qa.git;a=commitdiff;h=239016adc19a96b60d26bb0442cfd167a0776b18

Log:
Keep full response, even if github responds with 403

Changed paths:
  M  pulls/api.php


Diff:
diff --git a/pulls/api.php b/pulls/api.php
index 9913e07..e8d49c9 100644
--- a/pulls/api.php
+++ b/pulls/api.php
@@ -176,9 +176,14 @@ function ghupdate()
        }
 
        $url = 
GITHUB_BASEURL.'repos/'.GITHUB_ORG.'/'.urlencode($_POST['repo']).'/pulls/'.$_POST['id'];
-       $pull_raw = @file_get_contents($url);
+       $ctxt = stream_context_create(array(
+               'http' => array(
+                       'ignore_errors' => '1'
+               )
+       ));
+       $pull_raw = @file_get_contents($url, false, $ctxt);
        $pull = $pull_raw ? json_decode($pull_raw) : false;
-       if (!$pull) {
+       if (!$pull || empty($pull['state'])) {
                header('HTTP/1.0 400 Bad Request');
                $_SESSION['debug'][] = array(
                        "message" => "Request to GitHub failed",


--
PHP Quality Assurance Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to