From 9f5480eef4dcf36b9e31cfe85f9c56c7becc034d Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Tue, 13 Apr 2021 23:07:54 +0200 Subject: [PATCH] ensure redis returns bool for hasKey Signed-off-by: Arthur Schiwon --- lib/private/Http/Client/NegativeDnsCache.php | 2 +- lib/private/Memcache/Redis.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/Http/Client/NegativeDnsCache.php b/lib/private/Http/Client/NegativeDnsCache.php index 550d75a9c0..631fa19c90 100644 --- a/lib/private/Http/Client/NegativeDnsCache.php +++ b/lib/private/Http/Client/NegativeDnsCache.php @@ -46,6 +46,6 @@ class NegativeDnsCache { } public function isNegativeCached(string $domain, int $type) : bool { - return $this->cache->hasKey($this->createCacheKey($domain, $type)); + return (bool)$this->cache->hasKey($this->createCacheKey($domain, $type)); } } diff --git a/lib/private/Memcache/Redis.php b/lib/private/Memcache/Redis.php index 56470afa0c..303b3afb67 100644 --- a/lib/private/Memcache/Redis.php +++ b/lib/private/Memcache/Redis.php @@ -69,7 +69,7 @@ class Redis extends Cache implements IMemcacheTTL { } public function hasKey($key) { - return self::$cache->exists($this->getNameSpace() . $key); + return (bool)self::$cache->exists($this->getNameSpace() . $key); } public function remove($key) {