소스 검색

Simplify envvar credential parsing

Oliver Vartiainen 9 년 전
부모
커밋
aaee6dc0b0
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      src/Composer/Util/RemoteFilesystem.php

+ 1 - 2
src/Composer/Util/RemoteFilesystem.php

@@ -209,8 +209,7 @@ class RemoteFilesystem
 
         // Use COMPOSER_AUTH environment variable if set
         if (getenv('COMPOSER_AUTH')) {
-            $credentials = [];
-            preg_match('/(.+):(.+)/', getenv('COMPOSER_AUTH'), $credentials);
+            $credentials = explode(':', getenv('COMPOSER_AUTH'), 2);
 
             if (count($credentials) === 2) {
                 $this->io->setAuthentication($originUrl, $credentials[0], $credentials[1]);