From 8058d53f6aba1e803e4c7034ac166e66d49666ed Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 2 Aug 2018 10:57:53 +0800 Subject: [PATCH 1/2] MDL-63050 redis: Make session check compatible with Redis 4.0 --- lib/classes/session/redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/classes/session/redis.php b/lib/classes/session/redis.php index fefab50d7d6..a669996e764 100644 --- a/lib/classes/session/redis.php +++ b/lib/classes/session/redis.php @@ -396,7 +396,7 @@ class redis extends handler { } try { - return $this->connection->exists($sid); + return !empty($this->connection->exists($sid)); } catch (RedisException $e) { return false; } From 03587989eaaac09646fefea386009225b0e447bd Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 2 Aug 2018 10:59:53 +0800 Subject: [PATCH 2/2] MDL-63050 cachestore_redis: Update hExists to check empty --- cache/stores/redis/lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache/stores/redis/lib.php b/cache/stores/redis/lib.php index bcf56fddbbf..83a58892e5b 100644 --- a/cache/stores/redis/lib.php +++ b/cache/stores/redis/lib.php @@ -325,7 +325,7 @@ class cachestore_redis extends cache_store implements cache_is_key_aware, cache_ * @return bool True if the key exists, false if it does not. */ public function has($key) { - return $this->redis->hExists($this->hash, $key); + return !empty($this->redis->hExists($this->hash, $key)); } /**