From 373a8e79f616cd3836ff3c2154f91373f7802b6e Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Thu, 10 Sep 2026 16:31:07 +0200 Subject: [PATCH] fix: Use more strict comparaison Signed-off-by: Carl Schwan --- apps/files_external/lib/Lib/ApplicableHelper.php | 4 ++-- lib/private/GlobalScale/Config.php | 4 ++-- lib/private/TaskProcessing/Manager.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/files_external/lib/Lib/ApplicableHelper.php b/apps/files_external/lib/Lib/ApplicableHelper.php index 1c603ec2c647b..9b61a3e7f8611 100644 --- a/apps/files_external/lib/Lib/ApplicableHelper.php +++ b/apps/files_external/lib/Lib/ApplicableHelper.php @@ -51,12 +51,12 @@ public function isApplicableForUser(StorageConfig $storage, IUser $user): bool { if (count($storage->getApplicableUsers()) + count($storage->getApplicableGroups()) === 0) { return true; } - if (in_array($user->getUID(), $storage->getApplicableUsers())) { + if (in_array($user->getUID(), $storage->getApplicableUsers(), true)) { return true; } $groupIds = $this->groupManager->getUserGroupIds($user); foreach ($groupIds as $groupId) { - if (in_array($groupId, $storage->getApplicableGroups())) { + if (in_array($groupId, $storage->getApplicableGroups(), true)) { return true; } } diff --git a/lib/private/GlobalScale/Config.php b/lib/private/GlobalScale/Config.php index be35487f3c314..6edd0442f4843 100644 --- a/lib/private/GlobalScale/Config.php +++ b/lib/private/GlobalScale/Config.php @@ -52,7 +52,7 @@ public function isSecondary(): bool { #[Override] public function isPrimaryAdmin(string $userId): bool { - return in_array($userId, $this->config->getSystemValue('gss.master.admin', [])) - || in_array($userId, $this->config->getSystemValue('gss.primary.admin', [])); + return in_array($userId, $this->config->getSystemValue('gss.master.admin', []), true) + || in_array($userId, $this->config->getSystemValue('gss.primary.admin', []), true); } } diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php index 2de36b36b6819..6c705d3539c81 100644 --- a/lib/private/TaskProcessing/Manager.php +++ b/lib/private/TaskProcessing/Manager.php @@ -1759,7 +1759,7 @@ private function validateUserAccessToFile(mixed $fileId, ?string $userId): void } $mounts = $this->userMountCache->getMountsForFileId($fileId); $userIds = array_map(fn ($mount) => $mount->getUser()->getUID(), $mounts); - if (!in_array($userId, $userIds)) { + if (!in_array($userId, $userIds, true)) { throw new UnauthorizedException('User ' . $userId . ' does not have access to file ' . $fileId); } }