Skip to content

Commit 826e234

Browse files
committed
Correctly handle Redis::keys returning false
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent d647025 commit 826e234

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

build/stubs/redis.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2177,7 +2177,7 @@ public function pExpireAt($key, $timestamp)
21772177
*
21782178
* @param string $pattern pattern, using '*' as a wildcard
21792179
*
2180-
* @return array string[] The keys that match a certain pattern.
2180+
* @return string[]|false The keys that match a certain pattern.
21812181
*
21822182
* @link https://redis.io/commands/keys
21832183
* @example

lib/private/Memcache/Redis.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function clear($prefix = '') {
7878
$keys = self::$cache->keys($prefix);
7979
$deleted = self::$cache->del($keys);
8080

81-
return count($keys) === $deleted;
81+
return (is_array($keys) && (count($keys) === $deleted));
8282
}
8383

8484
/**

0 commit comments

Comments
 (0)