1
0
Fork 0

Fix URL handling for PEAR repositories

pull/110/merge
Jordi Boggiano 2011-11-20 21:33:54 +01:00
parent 4fdc602037
commit 8a127ed131
1 changed files with 3 additions and 0 deletions

View File

@ -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']);
}