1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 16:42:57 +00:00

Skip filter_var on 5.3.2 since it is buggy

This commit is contained in:
Jordi Boggiano 2012-04-27 14:04:39 +02:00
parent ed8aa8322a
commit 8ff497ac6f
3 changed files with 3 additions and 3 deletions

View file

@ -40,7 +40,7 @@ class ComposerRepository extends ArrayRepository implements NotifiableRepository
$repoConfig['url'] = 'http://'.$repoConfig['url'];
}
$repoConfig['url'] = rtrim($repoConfig['url'], '/');
if (function_exists('filter_var') && !filter_var($repoConfig['url'], FILTER_VALIDATE_URL)) {
if (function_exists('filter_var') && version_compare(PHP_VERSION, '5.3.3', '>=') && !filter_var($repoConfig['url'], FILTER_VALIDATE_URL)) {
throw new \UnexpectedValueException('Invalid url given for Composer repository: '.$repoConfig['url']);
}

View file

@ -39,7 +39,7 @@ class PearRepository extends ArrayRepository
$repoConfig['url'] = 'http://'.$repoConfig['url'];
}
if (function_exists('filter_var') && !filter_var($repoConfig['url'], FILTER_VALIDATE_URL)) {
if (function_exists('filter_var') && version_compare(PHP_VERSION, '5.3.3', '>=') && !filter_var($repoConfig['url'], FILTER_VALIDATE_URL)) {
throw new \UnexpectedValueException('Invalid url given for PEAR repository: '.$repoConfig['url']);
}