Skip to content

Commit

Permalink
fixup! fix(carddav): Check if SERVER variables are set before accessi…
Browse files Browse the repository at this point in the history
…ng them
  • Loading branch information
miaulalala committed May 17, 2023
1 parent a65b0a8 commit 3f19956
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/dav/lib/CardDAV/SystemAddressbook.php
Expand Up @@ -232,12 +232,13 @@ private function isFederation(): bool {
}

/** @psalm-suppress NoInterfaceProperties */
if (!isset($this->request->server['PHP_AUTH_USER']) || $this->request->server['PHP_AUTH_USER'] !== 'system') {
$server = $this->request->server;
if (!isset($server['PHP_AUTH_USER']) || $server['PHP_AUTH_USER'] !== 'system') {
return false;
}

/** @psalm-suppress NoInterfaceProperties */
$sharedSecret = $this->request->server['PHP_AUTH_PW'] ?? null;
$sharedSecret = $server['PHP_AUTH_PW'] ?? null;
if ($sharedSecret === null) {
return false;
}
Expand Down

0 comments on commit 3f19956

Please sign in to comment.