Skip to content

Commit 73e03fb

Browse files
bug #47979 [Cache] Fix dealing with ext-redis' multi/exec returning a bool (João Nogueira)
This PR was merged into the 5.4 branch. Discussion ---------- [Cache] Fix dealing with ext-redis' multi/exec returning a bool | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #46384 | License | MIT When using `phpredis` client, the execution of `multi/exec` might return a boolean instead of an array, leading to an error when yielding the result. Commits ------- 4d2b176 [Cache] Fix dealing with ext-redis' multi/exec returning a bool
2 parents 70b403d + 4d2b176 commit 73e03fb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,11 @@ private function pipeline(\Closure $generator, object $redis = null): \Generator
567567

568568
if (!$redis instanceof \Predis\ClientInterface && 'eval' === $command && $redis->getLastError()) {
569569
$e = new \RedisException($redis->getLastError());
570-
$results = array_map(function ($v) use ($e) { return false === $v ? $e : $v; }, $results);
570+
$results = array_map(function ($v) use ($e) { return false === $v ? $e : $v; }, (array) $results);
571+
}
572+
573+
if (\is_bool($results)) {
574+
return;
571575
}
572576

573577
foreach ($ids as $k => $id) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy