]> source.dussan.org Git - nextcloud-server.git/commitdiff
Correctly handle Redis::keys returning false 34342/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Thu, 29 Sep 2022 12:41:53 +0000 (14:41 +0200)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Fri, 30 Sep 2022 08:27:28 +0000 (08:27 +0000)
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 74d8da187fe58787deaa6241fb50c219dddef034..a697cbbca52e30f2c87f1035272b56751767df63 100644 (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));
        }
 
        /**