]> source.dussan.org Git - nextcloud-server.git/commitdiff
Correctly handle Redis::keys returning false 34328/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Thu, 29 Sep 2022 12:41:53 +0000 (14:41 +0200)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Thu, 29 Sep 2022 12:41:53 +0000 (14:41 +0200)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
build/stubs/redis.php
lib/private/Memcache/Redis.php

index e4872b81556b38094cfa8bd4a7740e0873760426..1a91e942fc40713d9ea4d6989db3f0e7f650c099 100644 (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
index 9b07da2d99cb7a861776d2d55fa79d4ff90aaaad..de38033ca32e434c00db05ea17921a83946408a1 100644 (file)
@@ -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));
        }
 
        /**