1
0
Fork 0

Fix handling of missing HOME env, fixes #10670

pull/10678/head
Jordi Boggiano 2022-03-30 15:37:47 +02:00
parent ccfbc16ac6
commit 2bd524fa9b
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 1 additions and 3 deletions

View File

@ -374,9 +374,7 @@ class Config
return (int) $this->config['cache-ttl'];
case 'home':
$val = Preg::replace('#^(\$HOME|~)(/|$)#', rtrim(Platform::getEnv('HOME') ?: Platform::getEnv('USERPROFILE'), '/\\') . '/', $this->config[$key]);
return rtrim($this->process($val, $flags), '/\\');
return rtrim($this->process(Platform::expandPath($this->config[$key]), $flags), '/\\');
case 'bin-compat':
$value = $this->getComposerEnv('COMPOSER_BIN_COMPAT') ?: $this->config[$key];