From: Bradley Taylor Date: Sun, 6 Feb 2022 17:20:19 +0000 (+0000) Subject: Cast value to int before performing math X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b5eec332e81b3bf59e7a7acefc90130d6866755f;p=civicrm-core.git Cast value to int before performing math --- diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index 2818626e95..c523454cc6 100644 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -425,7 +425,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { $batchTotal = 0; foreach ($params['field'] as $key => $value) { - $batchTotal += $value['total_amount']; + $batchTotal += ($value['total_amount'] ?: 0); //validate for soft credit fields if (!empty($params['soft_credit_contact_id'][$key]) && empty($params['soft_credit_amount'][$key])) {