Skip to content

Commit db22b29

Browse files
committed
Fix Psalm-issues
1 parent 9f7fe35 commit db22b29

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Auth/Source/Negotiate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function authenticate(array &$state): void
124124

125125
if (
126126
$disabled ||
127-
(!empty($_COOKIE['NEGOTIATE_AUTOLOGIN_DISABLE_PERMANENT']) &&
127+
(array_key_exists('NEGOTIATE_AUTOLOGIN_DISABLE_PERMANENT', $_COOKIE) &&
128128
$_COOKIE['NEGOTIATE_AUTOLOGIN_DISABLE_PERMANENT'] === 'true')
129129
) {
130130
Logger::debug('Negotiate - session disabled. falling back');
@@ -313,7 +313,7 @@ public function checkMask(): bool
313313
return true;
314314
}
315315

316-
$ip = Request::createFromGlobals()->getClientIp();
316+
$ip = Request::createFromGlobals()->getClientIp() ?? '127.0.0.1';
317317
Assert::notNull($ip, "Unable to determine client IP.");
318318

319319
if (IpUtils::checkIp($ip, $this->subnet)) {

0 commit comments

Comments
 (0)