From aa4779024c37bcac3de87173ccee2cebc27c5ec7 Mon Sep 17 00:00:00 2001 From: Civiware Solutions Date: Sun, 12 Aug 2018 01:36:34 +0530 Subject: [PATCH] added validation for money --- api/v3/GrantBudget.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/v3/GrantBudget.php b/api/v3/GrantBudget.php index fcac915..d65cea6 100644 --- a/api/v3/GrantBudget.php +++ b/api/v3/GrantBudget.php @@ -15,6 +15,9 @@ function civicrm_api3_grant_budget_create($params) { if (!empty($params['budget'])) { $params['budget'] = CRM_Utils_Rule::cleanMoney($params['budget']); + if (!is_numeric($params['budget'] )) { + throw new Exception(ts('Annual Budget is not in money format.')); + } } return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'GrantBudget'); }