1
0
Fork 0

Stop trying to bypass https since github does not and will not support non-https transports

pull/2053/head
Jordi Boggiano 2013-06-28 19:05:18 +02:00
parent 7755564962
commit a6e3b23ca5
1 changed files with 1 additions and 10 deletions

View File

@ -99,16 +99,7 @@ abstract class ArchiveDownloader extends FileDownloader
} }
if (!extension_loaded('openssl') && (0 === strpos($url, 'https:') || 0 === strpos($url, 'http://github.com'))) { if (!extension_loaded('openssl') && (0 === strpos($url, 'https:') || 0 === strpos($url, 'http://github.com'))) {
// bypass https for github if openssl is disabled throw new \RuntimeException('You must enable the openssl extension to download files via https');
if (preg_match('{^https://api\.github\.com/repos/([^/]+/[^/]+)/(zip|tar)ball/([^/]+)$}i', $url, $match)) {
$url = 'http://nodeload.github.com/'.$match[1].'/'.$match[2].'/'.$match[3];
} elseif (preg_match('{^https://github\.com/([^/]+/[^/]+)/(zip|tar)ball/([^/]+)$}i', $url, $match)) {
$url = 'http://nodeload.github.com/'.$match[1].'/'.$match[2].'/'.$match[3];
} elseif (preg_match('{^https://github\.com/([^/]+/[^/]+)/archive/([^/]+)\.(zip|tar\.gz)$}i', $url, $match)) {
$url = 'http://nodeload.github.com/'.$match[1].'/'.$match[3].'/'.$match[2];
} else {
throw new \RuntimeException('You must enable the openssl extension to download files via https');
}
} }
return parent::processUrl($package, $url); return parent::processUrl($package, $url);