Skip to content

Commit 2db7387

Browse files
authored
fix: return false on empty scan
Signed-off-by: Git'Fellow <[email protected]>
1 parent 5c09a9d commit 2db7387

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/private/Memcache/Redis.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ public function clear($prefix = '') {
9494
// Use SCAN to iterate over keys
9595
$cursor = 0;
9696
do {
97-
[$cursor, $keys] = $cache->scan($cursor, $prefix);
97+
$arr_keys = $cache->scan($cursor, $prefix);
98+
if ($arr_keys === false) {
99+
return false;
100+
}
101+
102+
[$cursor, $keys] = $arr_keys;
98103
if (!empty($keys)) {
99104
$deletedCount += $cache->unlink($keys);
100105
}

0 commit comments

Comments
 (0)