[tor-commits] [donate/master] Limit matched amount in counter to first 100k donated
peterh at torproject.org
peterh at torproject.org
Tue May 11 21:17:51 UTC 2021
commit 908a52069b793e16ffc06f895f465aab104ccfff
Author: Richard Esguerra <resguerra at giantrabbit.com>
Date: Fri Dec 11 14:20:51 2020 -0800
Limit matched amount in counter to first 100k donated
Contributions beyond $100k in the campaign period are not matched, so
this limits the doubling logic to the appropriate amount and supplies
the correct amount in the JSON used by the donate page counter.
Issue #49798
---
src/CampaignController.php | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/CampaignController.php b/src/CampaignController.php
index 1c795114..fd5715ca 100644
--- a/src/CampaignController.php
+++ b/src/CampaignController.php
@@ -18,7 +18,11 @@ class CampaignController extends BaseController {
$value = $redis->get($keyName);
$totals[$varName] = floatval($value);
}
- $totals['amountWithMozilla'] = $totals['totalAmount'] * 2;
+ if ($totals['totalAmount'] > 100000) {
+ $totals['amountWithMozilla'] = $totals['totalAmount'] + 100000;
+ } else {
+ $totals['amountWithMozilla'] = $totals['totalAmount'] * 2;
+ }
return $totals;
}
More information about the tor-commits
mailing list