From ca1650df9e24a20a51216a061d8fdde5baedb005 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 7 Aug 2022 18:45:36 +0200 Subject: [PATCH] Additional for [PR #2964](https://github.com/PHPOffice/PhpSpreadsheet/pull/2964); validate value after extracting from flattened array --- src/PhpSpreadsheet/Shared/JAMA/Matrix.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PhpSpreadsheet/Shared/JAMA/Matrix.php b/src/PhpSpreadsheet/Shared/JAMA/Matrix.php index 58ab8813..0bbd94a7 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/Matrix.php +++ b/src/PhpSpreadsheet/Shared/JAMA/Matrix.php @@ -1164,13 +1164,13 @@ class Matrix */ private function validateExtractedValue($value, bool $validValues): array { + if (!is_numeric($value) && is_array($value)) { + $value = Functions::flattenArray($value)[0]; + } if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { $value = trim($value, '"'); $validValues &= StringHelper::convertToNumberIfFraction($value); } - if (!is_numeric($value) && is_array($value)) { - $value = Functions::flattenArray($value)[0]; - } return [$value, $validValues]; }