mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-13 20:32:11 +02:00
[ticket/11603] Fix github api url and use curl with valid user agent
PHPBB3-11603
This commit is contained in:
parent
30801e1f0a
commit
e633ace072
@ -124,7 +124,12 @@ function get_repository_url($username, $repository, $ssh = false)
|
||||
|
||||
function api_request($query)
|
||||
{
|
||||
$contents = file_get_contents("http://github.com/api/v2/json/$query");
|
||||
$c = curl_init();
|
||||
curl_setopt($c, CURLOPT_URL, "https://api.github.com/$query");
|
||||
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($c, CURLOPT_USERAGENT, 'phpBB/1.0');
|
||||
$contents = curl_exec($c);
|
||||
curl_close($c);
|
||||
|
||||
if ($contents === false)
|
||||
{
|
||||
|
@ -145,7 +145,13 @@ function get_repository_url($username, $repository, $ssh = false)
|
||||
|
||||
function api_request($query)
|
||||
{
|
||||
$contents = file_get_contents("http://github.com/api/v2/json/$query");
|
||||
$c = curl_init();
|
||||
curl_setopt($c, CURLOPT_URL, "https://api.github.com/$query");
|
||||
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($c, CURLOPT_USERAGENT, 'phpBB/1.0');
|
||||
$contents = curl_exec($c);
|
||||
curl_close($c);
|
||||
|
||||
if ($contents === false)
|
||||
{
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user