From f78899c5ee83c8949d152aabc5c15964de0177cf Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Wed, 31 Jan 2024 02:41:57 +0100 Subject: [PATCH] Add safety check about cache value (#6283) --- src/Connection.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Connection.php b/src/Connection.php index 0d0d50de443..76b427b5b38 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -37,6 +37,7 @@ use function count; use function get_class; use function implode; +use function is_array; use function is_int; use function is_string; use function key; @@ -1137,6 +1138,10 @@ public function executeCacheQuery($sql, $params, $types, QueryCacheProfile $qcp) if ($item->isHit()) { $value = $item->get(); + if (! is_array($value)) { + $value = []; + } + if (isset($value[$realKey])) { return new Result(new ArrayResult($value[$realKey]), $this); }