com web/bugs: send headers here too: include/classes/bug_ghpu lltracker.php

From: Date: Fri, 10 May 2013 13:26:10 +0000
Subject: com web/bugs: send headers here too: include/classes/bug_ghpu lltracker.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-15844@lists.php.net to get a copy of this message
Commit: cf9e0a089a9bfdfa92b443291447bc9ce20c7dba Author: Ferenc Kovacs <tyra3l@gmail.com> 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; }

« previous php.webmaster (#15844) next »