소스 검색

Skip filter_var on 5.3.2 since it is buggy

Jordi Boggiano 13 년 전
부모
커밋
8ff497ac6f
3개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      src/Composer/Command/InitCommand.php
  2. 1 1
      src/Composer/Repository/ComposerRepository.php
  3. 1 1
      src/Composer/Repository/PearRepository.php

+ 1 - 1
src/Composer/Command/InitCommand.php

@@ -35,7 +35,7 @@ class InitCommand extends Command
     public function parseAuthorString($author)
     {
         if (preg_match('/^(?P<name>[- \.,\w\'’]+) <(?P<email>.+?)>$/u', $author, $match)) {
-            if (!function_exists('filter_var') || $match['email'] === filter_var($match['email'], FILTER_VALIDATE_EMAIL)) {
+            if (!function_exists('filter_var') || version_compare(PHP_VERSION, '5.3.3', '<') || $match['email'] === filter_var($match['email'], FILTER_VALIDATE_EMAIL)) {
                 return array(
                     'name'  => trim($match['name']),
                     'email' => $match['email']

+ 1 - 1
src/Composer/Repository/ComposerRepository.php

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

+ 1 - 1
src/Composer/Repository/PearRepository.php

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