8000 [Cache] Make sure we get the correct number of values from redis::mget() · symfony/symfony@685c36c · GitHub
[go: up one dir, main page]

Skip to content

Commit 685c36c

Browse files
thePanznicolas-grekas
authored andcommitted
[Cache] Make sure we get the correct number of values from redis::mget()
1 parent ed101fb commit 685c36c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Symfony/Component/Cache/Traits/RedisTrait.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,13 @@ protected function doFetch(array $ids)
179179
}
180180
});
181181
} else {
182-
$values = array_combine($ids, $this->redis->mget($ids));
182+
$values = $this->redis->mget($ids);
183+
184+
if (!\is_array($values) || \count($values) !== \count($ids)) {
185+
return [];
186+
}
187+
188+
$values = array_combine($ids, $values);
183189
}
184190

185191
foreach ($values as $id => $v) {

0 commit comments

Comments
 (0)
0