Skip to content

Commit 1366207

Browse files
author
robin.kluth
committed
1.1.17
* Skip autodetection if no `$clientIp` was found.
1 parent 08927a1 commit 1366207

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/LdapAuth.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ public function autoDetect($overrideIp = false)
8888
return 0;
8989
}
9090

91-
$clientIp = $overrideIp ? $overrideIp : (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']);
91+
$clientIp = $overrideIp ? $overrideIp : (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null));
92+
93+
if (empty($clientIp)) {
94+
Yii::debug('[Autodetect] No client ip detected, skipping auto detection', __METHOD__);
95+
return 0;
96+
}
9297

9398
$index = 0;
9499
foreach ($this->domains as $config) {

0 commit comments

Comments
 (0)