From 725850c5217c5b7ab02a9ee1371627463fec90be Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 3 Dec 2011 21:39:03 +0100 Subject: [PATCH] Fix github ssl bypass with http:// urls --- src/Composer/Downloader/FileDownloader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Downloader/FileDownloader.php b/src/Composer/Downloader/FileDownloader.php index 09a7a636f..1839fd232 100644 --- a/src/Composer/Downloader/FileDownloader.php +++ b/src/Composer/Downloader/FileDownloader.php @@ -50,9 +50,9 @@ abstract class FileDownloader implements DownloaderInterface echo 'Downloading '.$url.' to '.$fileName.PHP_EOL; - if (0 === strpos($url, 'https:') && !extension_loaded('openssl')) { + if (!extension_loaded('openssl') && (0 === strpos($url, 'https:') || 0 === strpos($url, 'http://github.com'))) { // bypass https for github if openssl is disabled - if (preg_match('{^https://(github.com/[^/]+/[^/]+/(zip|tar)ball/[^/]+)$}i', $url, $match)) { + if (preg_match('{^https?://(github.com/[^/]+/[^/]+/(zip|tar)ball/[^/]+)$}i', $url, $match)) { $url = 'http://nodeload.'.$match[1]; } else { throw new \RuntimeException('You must enable the openssl extension to download files via https');