Преглед на файлове

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'], '/');