PHP 8 fix for #Value!

This commit is contained in:
Dave Umrysh 2023-03-07 11:21:52 -07:00
parent 5100e1112a
commit 82b9e0295a

View File

@ -3440,8 +3440,23 @@ class PHPExcel_Calculation {
$arg = PHPExcel_Calculation_Functions::flattenSingleValue($arg); $arg = PHPExcel_Calculation_Functions::flattenSingleValue($arg);
} }
unset($arg); unset($arg);
// Remove the non-values
if(is_array($args)){
$args = array_diff($args, array("#VALUE!"));
if (count($args) === 0) {
$result = "";
}else{
$result = call_user_func_array($functionCall,$args); $result = call_user_func_array($functionCall,$args);
} }
}else{
if($args == "#VALUE!"){
$result = "";
}else{
$result = call_user_func_array($functionCall,$args);
}
}
}
// } // }
if ($functionName != 'MKMATRIX') { if ($functionName != 'MKMATRIX') {
$this->_debugLog->writeDebugLog('Evaluation Result for ', self::_localeFunc($functionName), '() function call is ', $this->_showTypeDetails($result)); $this->_debugLog->writeDebugLog('Evaluation Result for ', self::_localeFunc($functionName), '() function call is ', $this->_showTypeDetails($result));