Skip to content

Commit 98d0f20

Browse files
committed
Fix for checking updates from GitHub
* Default format of commits feed changed from XML to JSON.
1 parent 0fc2a0e commit 98d0f20

File tree

2 files changed

+114
-104
lines changed

2 files changed

+114
-104
lines changed

modules/market/market.class.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,10 @@ function admin(&$out)
421421
if (!isset($rec['LATEST_VERSION_URL'])) {
422422
if (preg_match('/github\.com/is', $rec['REPOSITORY_URL']) && (isset($rec['EXISTS']) || $rec['MODULE_NAME'] == $name)) {
423423
$git_url = str_replace('archive/master.tar.gz', 'commits/master.atom', $rec['REPOSITORY_URL']);
424-
$github_feed = getURL($git_url, 5 * 60);
424+
$options = array(
425+
CURLOPT_HTTPHEADER => array('Accept: application/xml')
426+
);
427+
$github_feed = getURL($git_url, 5 * 60, '', '', false, $options);
425428
$tmp = GetXMLTree($github_feed);
426429
if (is_array($tmp)) {
427430
$items_data = XMLTreeToArray($tmp);
@@ -571,7 +574,10 @@ function admin(&$out)
571574
if (!isset($rec['LATEST_VERSION_URL'])) {
572575
if (preg_match('/github\.com/is', $rec['REPOSITORY_URL']) && ($rec['EXISTS'] || $rec['MODULE_NAME'] == $name)) {
573576
$git_url = str_replace('archive/master.tar.gz', 'commits/master.atom', $rec['REPOSITORY_URL']);
574-
$github_feed = getURL($git_url, 5 * 60);
577+
$options = array(
578+
CURLOPT_HTTPHEADER => array('Accept: application/xml')
579+
);
580+
$github_feed = getURL($git_url, 5 * 60, '', '', false, $options);
575581
$tmp = GetXMLTree($github_feed);
576582
if (is_array($tmp)) {
577583
$items_data = XMLTreeToArray($tmp);

0 commit comments

Comments
 (0)