Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed amount value check #4

Merged
merged 2 commits into from
Jun 2, 2023
Merged

fixed amount value check #4

merged 2 commits into from
Jun 2, 2023

Conversation

Igor-Tkachenko
Copy link
Contributor

No description provided.

@Igor-Tkachenko Igor-Tkachenko requested review from codepuncher, danlapteacru and a team and removed request for danlapteacru and codepuncher June 1, 2023 16:01
@@ -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 = (! empty($_GET['amount']) ? (int) sanitize_text_field(wp_unslash($_GET['amount'])) : 0);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$donation = (! empty($_GET['amount']) ? (int) sanitize_text_field(wp_unslash($_GET['amount'])) : 0);
$donation = absint($_GET['amount'] ?? 0);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@Igor-Tkachenko Igor-Tkachenko merged commit 523edc8 into main Jun 2, 2023
2 checks passed
@Igor-Tkachenko Igor-Tkachenko deleted the fix-entries-data branch June 2, 2023 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants