From 04aad524ec3a7348f25d97d88464af4e316cd8e9 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 4 Nov 2020 21:29:33 +0100 Subject: [PATCH] Fix gitlab-domains/github-domains to avoid overwriting the default when another domain is configured, refs #9373 --- src/Composer/Config.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Composer/Config.php b/src/Composer/Config.php index 93396f191..76504c7ce 100644 --- a/src/Composer/Config.php +++ b/src/Composer/Config.php @@ -138,6 +138,8 @@ class Config foreach ($config['config'] as $key => $val) { if (in_array($key, array('bitbucket-oauth', 'github-oauth', 'gitlab-oauth', 'gitlab-token', 'http-basic', 'bearer')) && isset($this->config[$key])) { $this->config[$key] = array_merge($this->config[$key], $val); + } elseif (in_array($key, array('gitlab-domains', 'github-domains')) && isset($this->config[$key])) { + $this->config[$key] = array_unique(array_merge($this->config[$key], $val)); } elseif ('preferred-install' === $key && isset($this->config[$key])) { if (is_array($val) || is_array($this->config[$key])) { if (is_string($val)) {