Merge pull request #2995 from PHPOffice/Matrix-Operations-Additional
Additional for PR #2964; validate value after extracting from flattened array
This commit is contained in:
commit
d13b07ba6e
|
|
@ -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];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue