Skip to content

Commit f66f2ac

Browse files
authored
Merge pull request #34342 from nextcloud/backport/34328/stable23
[stable23] Correctly handle Redis::keys returning false
2 parents dfa4feb + e4ce2e7 commit f66f2ac

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
@@ -128,7 +128,7 @@ public function clear($prefix = '') {
128128
$keys = self::$cache->keys($prefix);
129129
$deleted = self::$cache->del($keys);
130130

131-
return count($keys) === $deleted;
131+
return (is_array($keys) && (count($keys) === $deleted));
132132
}
133133

134134
/**

0 commit comments

Comments
 (0)