1
0
Fork 0

Simplify envvar credential parsing

pull/4546/head
Oliver Vartiainen 2015-10-27 20:44:10 +02:00
parent e9cac53f90
commit aaee6dc0b0
1 changed files with 1 additions and 2 deletions

View File

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