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

Enhancement: prevent serialized data by default #7583

Merged
merged 14 commits into from
Oct 31, 2024

Conversation

glaubersilva
Copy link
Contributor

@glaubersilva glaubersilva commented Oct 23, 2024

Resolves GIVE-1294

Description

This PR implements a few improvements and unit tests for our Utils functions related to serialized data.

This PR also changes the give_clean() function to unserialize all data input by default, but it is possible to allow serialized data by setting the $allow_serialized_data to true.

Last, but not least important, this PR also adds a new migration to unserialize data from the _give_donor_billing_title_prefix donation meta value.

Affects

As many places are using the give_clean() method, these changes affect the entire codebase, but especially the submission of new donations for v2 forms.

Testing Instructions

  1. Run the composer test -- --filter UtilsTest command in your terminal.
  2. Manually submit a few donations using v2 forms.

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Includes unit tests
  • Reviewed by the designer (if follows a design)
  • Self Review of code and UX completed

@glaubersilva glaubersilva marked this pull request as ready for review October 23, 2024 19:10
@glaubersilva glaubersilva changed the title Enhancement: Enhancement: prevent serialize data by default Enhancement: prevent serialize data by default Oct 25, 2024
@glaubersilva glaubersilva changed the title Enhancement: prevent serialize data by default Enhancement: prevent serialized data by default Oct 25, 2024
Copy link
Contributor

@jonwaldstein jonwaldstein left a comment

Choose a reason for hiding this comment

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

@glaubersilva awesome job, thanks for doing this! (just added a few notes)

includes/process-donation.php Outdated Show resolved Hide resolved
includes/formatting.php Show resolved Hide resolved
Copy link
Member

@rickalday rickalday left a comment

Choose a reason for hiding this comment

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

Passed manual QA tests.

@glaubersilva glaubersilva merged commit dbf0619 into develop Oct 31, 2024
20 checks passed
@glaubersilva glaubersilva deleted the enhancement/give-clean-unserialize-GIVE-1294 branch October 31, 2024 13:59
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.

3 participants