Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Correctly handle Redis::keys returning false
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Sep 29, 2022
commit 826e234ecfa37b831df85c80606df6875574527f
2 changes: 1 addition & 1 deletion build/stubs/redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -2177,7 +2177,7 @@ public function pExpireAt($key, $timestamp)
*
* @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
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Memcache/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function clear($prefix = '') {
$keys = self::$cache->keys($prefix);
$deleted = self::$cache->del($keys);

return count($keys) === $deleted;
return (is_array($keys) && (count($keys) === $deleted));
}

/**
Expand Down