Skip to content

Commit d13b07b

Browse files
authored
Merge pull request #2995 from PHPOffice/Matrix-Operations-Additional
Additional for PR #2964; validate value after extracting from flattened array
2 parents c34662b + ca1650d commit d13b07b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/PhpSpreadsheet/Shared/JAMA/Matrix.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,13 +1164,13 @@ public function det()
11641164
*/
11651165
private function validateExtractedValue($value, bool $validValues): array
11661166
{
1167+
if (!is_numeric($value) && is_array($value)) {
1168+
$value = Functions::flattenArray($value)[0];
1169+
}
11671170
if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
11681171
$value = trim($value, '"');
11691172
$validValues &= StringHelper::convertToNumberIfFraction($value);
11701173
}
1171-
if (!is_numeric($value) && is_array($value)) {
1172-
$value = Functions::flattenArray($value)[0];
1173-
}
11741174

11751175
return [$value, $validValues];
11761176
}

0 commit comments

Comments
 (0)