projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
87f2c4f
)
Add in deprecated warning if amount is not numeric and use filter var to return appro...
author
Seamus Lee
<seamuslee001@gmail.com>
Thu, 15 Apr 2021 01:34:44 +0000
(11:34 +1000)
committer
Seamus Lee
<seamuslee001@gmail.com>
Thu, 15 Apr 2021 01:34:44 +0000
(11:34 +1000)
CRM/Core/Payment.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Core/Payment.php
b/CRM/Core/Payment.php
index 8a2b58fe384cf4e00dfa8d830985a0ea3dfb1ecc..e19da90c3a5e19e2617fef8ac78cf0a21befb0e5 100644
(file)
--- a/
CRM/Core/Payment.php
+++ b/
CRM/Core/Payment.php
@@
-1164,6
+1164,10
@@
abstract class CRM_Core_Payment {
* @throws \CRM_Core_Exception
*/
protected function getAmount($params = []) {
+ if (!CRM_Utils_Rule::numeric($params['amount'])) {
+ CRM_Core_Error::deprecatedWarning('Passing Amount value that is not numeric is deprecated please report this in gitlab');
+ return filter_var($params['amount'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
+ }
return $params['amount'];
}