1
0
Fork 0

Add hard failure if COMPOSER_AUTH is malformed json, fixes #11085

pull/11115/head
Jordi Boggiano 2022-10-12 16:56:44 +02:00
parent 06359da3a3
commit 2c1b309cd3
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 1 additions and 3 deletions

View File

@ -219,9 +219,7 @@ class Factory
if ($composerAuthEnv = Platform::getEnv('COMPOSER_AUTH')) { if ($composerAuthEnv = Platform::getEnv('COMPOSER_AUTH')) {
$authData = json_decode($composerAuthEnv); $authData = json_decode($composerAuthEnv);
if (null === $authData) { if (null === $authData) {
if ($io instanceof IOInterface) { throw new \UnexpectedValueException('COMPOSER_AUTH environment variable is malformed, should be a valid JSON object');
$io->writeError('<error>COMPOSER_AUTH environment variable is malformed, should be a valid JSON object</error>');
}
} else { } else {
if ($io instanceof IOInterface) { if ($io instanceof IOInterface) {
$io->writeError('Loading auth config from COMPOSER_AUTH', true, IOInterface::DEBUG); $io->writeError('Loading auth config from COMPOSER_AUTH', true, IOInterface::DEBUG);