Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRaul <r.ferreira.fuentes@gmail.com>2022-10-26 15:51:24 +0300
committerRaul <r.ferreira.fuentes@gmail.com>2022-10-26 15:58:45 +0300
commitd8e4490db81318eaca8da50e304e5a23f8db4adb (patch)
tree4131b7dc066f8376584e457f89b2e8fff35397f3 /lib
parentb63cead2a02c1d348f2aff1eeddaca6bda4c0542 (diff)
Prevent caching `false` in SessionService
Signed-off-by: Raul <r.ferreira.fuentes@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Service/SessionService.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Service/SessionService.php b/lib/Service/SessionService.php
index eab4fec8c..f06cb553b 100644
--- a/lib/Service/SessionService.php
+++ b/lib/Service/SessionService.php
@@ -165,12 +165,17 @@ class SessionService {
try {
$data = $this->sessionMapper->find($documentId, $sessionId, $token);
- $this->cache->set($token, json_encode($data), self::SESSION_VALID_TIME - 30);
- return $data;
+ $jsonData = json_encode($data);
+
+ if ($jsonData) {
+ $this->cache->set($token, json_encode($data), self::SESSION_VALID_TIME - 30);
+ return $data;
+ }
} catch (DoesNotExistException $e) {
- $this->session = false;
- return false;
}
+
+ $this->session = false;
+ return false;
}
public function isValidSession($documentId, $sessionId, $token): bool {