diff --git a/lib/Db/SessionMapper.php b/lib/Db/SessionMapper.php index 186f81929c..41254f3029 100644 --- a/lib/Db/SessionMapper.php +++ b/lib/Db/SessionMapper.php @@ -34,7 +34,7 @@ public function find(int $boardId, string $userId, string $token): Session { throw new DoesNotExistException('Session is invalid'); } $session = Session::fromRow($data); - if ($session->getUserId() != $userId || $session->getBoardId() != $boardId) { + if ($session->getUserId() !== $userId || $session->getBoardId() !== $boardId) { throw new DoesNotExistException('Session is invalid'); } return $session; diff --git a/lib/Service/SessionService.php b/lib/Service/SessionService.php index 0f4c76f383..5a955270fc 100644 --- a/lib/Service/SessionService.php +++ b/lib/Service/SessionService.php @@ -71,7 +71,7 @@ public function closeSession(int $boardId, string $token): void { } $this->eventDispatcher->dispatchTyped(new SessionClosedEvent($boardId, $this->userId)); } - + public function removeInactiveSessions(): int { return $this->sessionMapper->deleteInactive(); } @@ -90,7 +90,7 @@ public function notifyAllSessions(IQueue $queue, int $boardId, $event, $body, $c } // don't notify the same user multiple times - if (!in_array($session->getUserId(), $userIds)) { + if (!in_array($session->getUserId(), $userIds, true)) { $userIds[] = $session->getUserId(); } }