From 2db73873b529efcaad1abf76e6a366e697b95231 Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Sun, 17 Nov 2024 12:57:09 +0100 Subject: [PATCH] fix: return false on empty scan Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- lib/private/Memcache/Redis.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/private/Memcache/Redis.php b/lib/private/Memcache/Redis.php index aa38e6cefa4d1..f87cc8ab1f138 100644 --- a/lib/private/Memcache/Redis.php +++ b/lib/private/Memcache/Redis.php @@ -94,7 +94,12 @@ public function clear($prefix = '') { // Use SCAN to iterate over keys $cursor = 0; do { - [$cursor, $keys] = $cache->scan($cursor, $prefix); + $arr_keys = $cache->scan($cursor, $prefix); + if ($arr_keys === false) { + return false; + } + + [$cursor, $keys] = $arr_keys; if (!empty($keys)) { $deletedCount += $cache->unlink($keys); }