Additional for [PR #2964](https://github.com/PHPOffice/PhpSpreadsheet/pull/2964); validate value after extracting from flattened array

This commit is contained in:
MarkBaker 2022-08-07 18:45:36 +02:00
parent c34662b8b2
commit ca1650df9e
1 changed files with 3 additions and 3 deletions

View File

@ -1164,13 +1164,13 @@ class Matrix
*/ */
private function validateExtractedValue($value, bool $validValues): array 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))) { if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
$value = trim($value, '"'); $value = trim($value, '"');
$validValues &= StringHelper::convertToNumberIfFraction($value); $validValues &= StringHelper::convertToNumberIfFraction($value);
} }
if (!is_numeric($value) && is_array($value)) {
$value = Functions::flattenArray($value)[0];
}
return [$value, $validValues]; return [$value, $validValues];
} }