Skip to content

Commit

Permalink
Merge pull request #4 from ItinerisLtd/fix-entries-data
Browse files Browse the repository at this point in the history
fixed amount value check
  • Loading branch information
Igor-Tkachenko authored Jun 2, 2023
2 parents 822077b + a61db4c commit 523edc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/GiftAidField.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function get_calculated_gift(): string
// phpcs:ignore Generic.Files.LineLength.TooLong
$calculationText = 'With Gift Aid, your donation of {{ donation }} would be worth {{ calculated_gift_aid }} at no extra cost to you.';
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$donation = (isset($_GET['amount']) ? sanitize_text_field(wp_unslash($_GET['amount'])) : 0);
$donation = absint($_GET['amount'] ?? 0);
$amount = ($donation * 25) / 100;
$totalAmt = $donation + $amount;
$displayNum = number_format((float) $totalAmt, 2, '.', '');
Expand Down

0 comments on commit 523edc8

Please sign in to comment.