Skip to content

Commit fe827be

Browse files
author
Robin Kluth
committed
fix(autodetect): Fix ordering of the autrodetected domains array
1 parent 02dce45 commit fe827be

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/LdapAuth.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,11 @@ public function init()
9393
// Sort the domains one time for this run!
9494
$autoDetectDomainKey = $this->autoDetect();
9595

96-
$domains = $this->domains;
97-
9896
if ($autoDetectDomainKey) {
9997
Yii::debug("AutoDetected domain: #" . $autoDetectDomainKey, __METHOD__);
100-
unset($domains[$autoDetectDomainKey]);
101-
$domains = array_merge([$this->domains[$autoDetectDomainKey]], $domains);
102-
$this->domains = $domains;
98+
$detectedDomain = $this->domains[$autoDetectDomainKey];
99+
unset($this->domains[$autoDetectDomainKey]);
100+
$this->domains = [$autoDetectDomainKey => $detectedDomain] + $this->domains;
103101
} else {
104102
Yii::debug('AutoDetect was not successful!', __METHOD__);
105103
}

0 commit comments

Comments
 (0)