Additional for [PR #2964](https://github.com/PHPOffice/PhpSpreadsheet/pull/2964); validate value after extracting from flattened array
This commit is contained in:
parent
c34662b8b2
commit
ca1650df9e
|
|
@ -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];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue