Browse Source

Merge pull request #34341 from nextcloud/backport/34328/stable24

[stable24] Correctly handle Redis::keys returning false
blizzz 1 year ago
parent
commit
2993aaa2b0
2 changed files with 2 additions and 2 deletions
  1. 1 1
      build/stubs/redis.php
  2. 1 1
      lib/private/Memcache/Redis.php

+ 1 - 1
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

+ 1 - 1
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));
 	}
 
 	/**