Commit:    cf9e0a089a9bfdfa92b443291447bc9ce20c7dba
Author:    Ferenc Kovacs <[email protected]>         Fri, 10 May 2013 15:26:10 
+0200
Parents:   285c912d74b0ff50ec9b18c111ee7d2cbf021346
Branches:  master

Link:       
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=cf9e0a089a9bfdfa92b443291447bc9ce20c7dba

Log:
send headers here too

Changed paths:
  M  include/classes/bug_ghpulltracker.php


Diff:
diff --git a/include/classes/bug_ghpulltracker.php 
b/include/classes/bug_ghpulltracker.php
index bf4c80d..4af361b 100644
--- a/include/classes/bug_ghpulltracker.php
+++ b/include/classes/bug_ghpulltracker.php
@@ -3,6 +3,8 @@
 class Bug_Pulltracker
 {
        var $_dbh;
+       private $userAgent = 'bugs.php.net Pulltracker';
+
 
        function __construct()
        {
@@ -11,7 +13,13 @@ class Bug_Pulltracker
 
        private function getDataFromGithub($repo, $pull_id)
        {
-               $data = 
@json_decode(file_get_contents("https://api.github.com/repos/php/".urlencode($repo).'/pulls/'.((int)$pull_id)));
+               $ctxt = stream_context_create(array(
+                       'http' => array(
+                               'ignore_errors' => '1',
+                               'user_agent' => $this->userAgent,
+                       )
+               ));
+               $data = 
@json_decode(file_get_contents("https://api.github.com/repos/php/".urlencode($repo).'/pulls/'.((int)$pull_id)),
 null, $ctxt);
                if (!is_object($data)) {
                        return false;
                }


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

Reply via email to