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

Discount code error message strips single quotes #2935

Merged

Conversation

MaximilianoRicoTabo
Copy link
Contributor

  • Remove unwanted strip quotes function, esc_html should strip all unwanted chars.
Screenshot 2024-04-04 at 12 05 29 PM

All Submissions:

Changes proposed in this Pull Request:

Resolves #2882.

How to test the changes in this Pull Request:

  1. Reproduce bug with steps from linked issue.
  2. Apply this patch
  3. Check issue does not happen anymore

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run tests with your changes locally?

Changelog entry

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

 * Remove unwanted strip quotes function, esc_html should strip all unwanted chars.
Copy link
Member

@dparker1005 dparker1005 left a comment

Choose a reason for hiding this comment

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

My gut reaction was that pmpro_no_quotes() may have been used to protect strings when echoing this content into JS code. But since this content is not being outputted into JS code, it should be safe when wrapped in esc_html().

@MaximilianoRicoTabo
Copy link
Contributor Author

MaximilianoRicoTabo commented Apr 5, 2024

I thought the same @dparker1005 , even more, went through history and saw how code evolved, pmpro_no_quotes was added like 10 years ago, and just several years later the esc_html function. Likely the intention was to strip odd chars and escape string and then several years ago esc_html function arrive to the WP ecosystem ? Not sure, perhaps we can ask Jason if he recall why was that function there.

@dparker1005
Copy link
Member

I think you're probably right, but either way, this PR seems good to go

@ideadude ideadude merged commit 2bdccc3 into strangerstudios:dev Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discount code error message strips single quotes
4 participants