aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hackl <hackl@data-quest.de>2024-10-25 12:40:29 +0200
committerThomas Hackl <hackl@data-quest.de>2024-10-25 12:42:40 +0200
commit91b6e6b21017da388680612ed7fbb3d0abd517c6 (patch)
tree9aec9f5bc02b6d37bb6aa9fba3ea8832c39fe5b8
parentca189bb9467b7976076bc5f41206e171b02d065d (diff)
Resolve "MemcachedCache übergibt Werte nicht serialisiert"
Closes #4768 Merge request !3554
-rw-r--r--lib/classes/StudipMemcachedCache.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/classes/StudipMemcachedCache.php b/lib/classes/StudipMemcachedCache.php
index 0e44dd5..57ffa7b 100644
--- a/lib/classes/StudipMemcachedCache.php
+++ b/lib/classes/StudipMemcachedCache.php
@@ -95,7 +95,9 @@ class StudipMemcachedCache implements StudipCache
public function read($arg)
{
$key = $this->getCacheKey($arg);
- return $this->memcache->get($key);
+ $result = $this->memcache->get($key);
+
+ return ($result === null) ? null : unserialize($result);
}
/**
@@ -111,7 +113,7 @@ class StudipMemcachedCache implements StudipCache
public function write($arg, $content, $expire = self::DEFAULT_EXPIRATION)
{
$key = $this->getCacheKey($arg);
- return $this->memcache->set($key, $content, $expire);
+ return $this->memcache->set($key, serialize($content), $expire);
}
/**