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
Fix coupon codes containing apostrophes #40998
Conversation
Test Results SummaryCommit SHA: c9605fd
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and works well, thanks!
@mikejolley I can't get the tests working locally on this to debug, but I dismissed my review based on that. |
d296064
to
8efa7d1
Compare
98a24e1
to
a92cd0b
Compare
Hi @opr, Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, tests OK. Clarified that wp_kses
adds slashes unless you've got the unfiltered_html
which is why we're removing them specifically for users without that capability.
Thanks Mike!
95ec4fa
to
c9605fd
Compare
Submission Review Guidelines:
Changes proposed in this Pull Request:
Updates the
wc_sanitize_coupon_code
function to allow the'
character. I have included a additional test to cover this case, and I fixed a notice I encountered while testing which prevented me applying coupons (PHP8 notice due to a missing variable).Closes #39481
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
test's
. Any value is fine.test's
should be visible in the coupon table. It should not betest\'s
.test's
coupon can be applied to the cart. Place the order and ensure the coupon continues to function correctly.Changelog entry
Significance
Type
Message
Fixed coupon errors with coupon codes containing apostrophes.
Comment