From abaa1029198bfab674580088987772d14d8fac30 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Wed, 13 Apr 2022 20:18:21 +0200 Subject: [PATCH] Resolve issue with boolean in branch pruning when array is expected --- src/PhpSpreadsheet/Calculation/Calculation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index fe310be4..f30b1118 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -4413,7 +4413,7 @@ class Calculation true : (bool) Functions::flattenSingleValue($storeValue); if (is_array($storeValue)) { $wrappedItem = end($storeValue); - $storeValue = end($wrappedItem); + $storeValue = is_array($wrappedItem) ? end($wrappedItem) : $wrappedItem; } if ( @@ -4445,7 +4445,7 @@ class Calculation true : (bool) Functions::flattenSingleValue($storeValue); if (is_array($storeValue)) { $wrappedItem = end($storeValue); - $storeValue = end($wrappedItem); + $storeValue = is_array($wrappedItem) ? end($wrappedItem) : $wrappedItem; } if (