From c99982bae93cb30414fc727326b3c1ad29b5f5cc Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Thu, 29 Sep 2022 14:41:53 +0200 Subject: [PATCH] Correctly handle Redis::keys returning false MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- build/stubs/redis.php | 2 +- lib/private/Memcache/Redis.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/stubs/redis.php b/build/stubs/redis.php index e4872b81556..1a91e942fc4 100644 --- a/build/stubs/redis.php +++ b/build/stubs/redis.php @@ -2177,7 +2177,7 @@ class Redis * * @param string $pattern pattern, using '*' as a wildcard * - * @return array string[] The keys that match a certain pattern. + * @return string[]|false The keys that match a certain pattern. * * @link https://redis.io/commands/keys * @example diff --git a/lib/private/Memcache/Redis.php b/lib/private/Memcache/Redis.php index 9b07da2d99c..de38033ca32 100644 --- a/lib/private/Memcache/Redis.php +++ b/lib/private/Memcache/Redis.php @@ -78,7 +78,7 @@ class Redis extends Cache implements IMemcacheTTL { $keys = self::$cache->keys($prefix); $deleted = self::$cache->del($keys); - return count($keys) === $deleted; + return (is_array($keys) && (count($keys) === $deleted)); } /** -- 2.39.5