aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2022-09-30 10:15:01 +0200
committerGitHub <noreply@github.com>2022-09-30 10:15:01 +0200
commit534fbd83e3c20f1d52c826e5ac4a80d44f4f6be8 (patch)
tree6577fb94c04056b812ffffff95e91b6f758747d7
parent27ce4bd1a41c11ab4ffe076df50a5f42402c8cf2 (diff)
parent826e234ecfa37b831df85c80606df6875574527f (diff)
downloadnextcloud-server-534fbd83e3c20f1d52c826e5ac4a80d44f4f6be8.tar.gz
nextcloud-server-534fbd83e3c20f1d52c826e5ac4a80d44f4f6be8.zip
Merge pull request #34328 from nextcloud/fix/fix-redis-type-error
Correctly handle Redis::keys returning false
-rw-r--r--build/stubs/redis.php2
-rw-r--r--lib/private/Memcache/Redis.php2
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));
}
/**