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:
56c1111
)
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
eileen
<emcnaughton@wikimedia.org>
Mon, 19 Apr 2021 01:21:56 +0000
(13:21 +1200)
CRM/Core/Payment.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Core/Payment.php
b/CRM/Core/Payment.php
index 491ad8939b42648208863786d1731cfe6520516e..86ea55a019fc9583da39b34824d4de5f9644cc31 100644
(file)
--- a/
CRM/Core/Payment.php
+++ b/
CRM/Core/Payment.php
@@
-1174,6
+1174,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'];
}