Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Harden check when using token from memcache
Explicitly comparing never hurt anybody.

Signed-off-by: Roeland Jago Douma <[email protected]>
  • Loading branch information
rullzer committed Sep 5, 2020
commit 57ab100044d54b7198857add981c643deda54822
9 changes: 8 additions & 1 deletion lib/Service/SessionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,14 @@ public function getSession($documentId, $sessionId, $token) {

$data = $this->cache->get($token);
if ($data !== null) {
return Session::fromRow(json_decode($data, true));
$session = Session::fromRow(json_decode($data, true));
if ($session->getId() !== $sessionId || $session->getDocumentId() !== $documentId) {
$this->cache->remove($token);
$this->session = false;
return false;
}

return $session;
}

try {
Expand Down