From 8a127ed131d66d166a717898839f14372e6a873e Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 20 Nov 2011 21:33:54 +0100 Subject: [PATCH] Fix URL handling for PEAR repositories --- src/Composer/Repository/PearRepository.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Composer/Repository/PearRepository.php b/src/Composer/Repository/PearRepository.php index 7d947fda4..cf07a3cc6 100644 --- a/src/Composer/Repository/PearRepository.php +++ b/src/Composer/Repository/PearRepository.php @@ -24,6 +24,9 @@ class PearRepository extends ArrayRepository public function __construct(array $config) { + if (!preg_match('{^https?://}', $config['url'])) { + $config['url'] = 'http://'.$config['url']; + } if (!filter_var($config['url'], FILTER_VALIDATE_URL)) { throw new \UnexpectedValueException('Invalid url given for PEAR repository: '.$config['url']); }