From 34b8a4395ad0bae73015559fee100823f08365f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20H=C3=A4rdeman?= Date: Thu, 26 Aug 2021 23:32:23 +0200 Subject: [PATCH] [redis] Fix call to setex() \Predis\Client\setex doesn't return a boolean, but the current Redis caching functionality expects it to do so. --- .../v/0.0.0/app/libraries/MailSo/Cache/Drivers/Redis.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Cache/Drivers/Redis.php b/snappymail/v/0.0.0/app/libraries/MailSo/Cache/Drivers/Redis.php index 53c5db0b9..94345c037 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Cache/Drivers/Redis.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Cache/Drivers/Redis.php @@ -70,7 +70,14 @@ class Redis implements \MailSo\Cache\DriverInterface public function Set(string $sKey, string $sValue) : bool { - return $this->oRedis ? $this->oRedis->setex($this->generateCachedKey($sKey), $this->iExpire, $sValue) : false; + if (!$this->oRedis) + { + return false; + } + + $sValue = $this->oRedis->setex($this->generateCachedKey($sKey), $this->iExpire, $sValue); + + return $sValue === true || $sValue == 'OK'; } public function Get(string $sKey) : string