소스 검색

Allow for file://-URLs here as well

Matthias Pigulla 13 년 전
부모
커밋
4e1cb32f8c
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/Composer/Repository/ComposerRepository.php

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

@@ -26,7 +26,8 @@ class ComposerRepository extends ArrayRepository
 
     public function __construct(array $config)
     {
-        if (!preg_match('{^https?://}', $config['url'])) {
+        if (!preg_match('{^\w+://}', $config['url'])) {
+                  // assume http as the default protocol
             $config['url'] = 'http://'.$config['url'];
         }
         $config['url'] = rtrim($config['url'], '/');