diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2021-03-02 19:34:20 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2021-03-03 14:52:47 +0100 |
commit | 68ec18323d07e7293fd59c82d51300a6d9d68176 (patch) | |
tree | f8b2094b663d481dda920d1df8f9c852fa42ee36 /lib/private/Template | |
parent | 252d2d39583c7daf838a6a24d0f72660ed01c371 (diff) | |
download | nextcloud-server-68ec18323d07e7293fd59c82d51300a6d9d68176.tar.gz nextcloud-server-68ec18323d07e7293fd59c82d51300a6d9d68176.zip |
Fix types in the Group Manager
Psalm found an issue. However the issue found was because of lying
docblocks. Fixed those and did some typing to make it all better.
For #25839
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Template')
-rw-r--r-- | lib/private/Template/JSConfigHelper.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php index b228cae6ffb..cd466575601 100644 --- a/lib/private/Template/JSConfigHelper.php +++ b/lib/private/Template/JSConfigHelper.php @@ -167,7 +167,7 @@ class JSConfigHelper { $countOfDataLocation = 0; $dataLocation = str_replace(\OC::$SERVERROOT . '/', '', $this->config->getSystemValue('datadirectory', ''), $countOfDataLocation); - if ($countOfDataLocation !== 1 || !$this->groupManager->isAdmin($uid)) { + if ($countOfDataLocation !== 1 || $uid === null || !$this->groupManager->isAdmin($uid)) { $dataLocation = false; } @@ -198,7 +198,7 @@ class JSConfigHelper { $array = [ "_oc_debug" => $this->config->getSystemValue('debug', false) ? 'true' : 'false', - "_oc_isadmin" => $this->groupManager->isAdmin($uid) ? 'true' : 'false', + "_oc_isadmin" => $uid !== null && $this->groupManager->isAdmin($uid) ? 'true' : 'false', "backendAllowsPasswordConfirmation" => $userBackendAllowsPasswordConfirmation ? 'true' : 'false', "oc_dataURL" => is_string($dataLocation) ? "\"" . $dataLocation . "\"" : 'false', "_oc_webroot" => "\"" . \OC::$WEBROOT . "\"", |