Correctly handle Redis::keys returning false

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2022-09-29 14:41:53 +02:00 committed by backportbot-nextcloud[bot]
parent dfa4feb339
commit e4ce2e71cc
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -128,7 +128,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));
}
/**