aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-06-11 14:53:03 +0200
committerJoas Schilling <nickvergessen@gmx.de>2013-06-13 16:16:44 +0200
commite633ace07267579d9860a165e288fbd1ed4ba442 (patch)
tree47966e0ad64c256f04aa086525c60491e9e7529a
parentMerge remote-tracking branch 'marc1706/ticket/11579' into develop-olympus (diff)
downloadphpbb-e633ace07267579d9860a165e288fbd1ed4ba442.tar.gz
phpbb-e633ace07267579d9860a165e288fbd1ed4ba442.tar.bz2
phpbb-e633ace07267579d9860a165e288fbd1ed4ba442.zip
[ticket/11603] Fix github api url and use curl with valid user agent
PHPBB3-11603
-rwxr-xr-xgit-tools/merge.php7
-rwxr-xr-xgit-tools/setup_github_network.php8
2 files changed, 13 insertions, 2 deletions
diff --git a/git-tools/merge.php b/git-tools/merge.php
index 41a96c0890..2acd2280b9 100755
--- a/git-tools/merge.php
+++ b/git-tools/merge.php
@@ -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)
{
diff --git a/git-tools/setup_github_network.php b/git-tools/setup_github_network.php
index 5f2e1609a7..87ce2616e3 100755
--- a/git-tools/setup_github_network.php
+++ b/git-tools/setup_github_network.php
@@ -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;