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

Fixing HTML in check instructions #3293 #3295

Merged

Conversation

derekashauer
Copy link
Contributor

@derekashauer derekashauer commented Feb 11, 2025

Instructions for check payments would save with < p > tags wrapping everything and show it in the admin textarea box after saving

All Submissions:

Changes proposed in this Pull Request:

Resolves #3293 by using esc_textarea to properly prep the text for the textarea field

How to test the changes in this Pull Request:

  1. Admin settings go to Payment Gateway
  2. Choose check
  3. Enter instructions, save

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.

Fix issue saving check payment instructions adding unnecessary < p > tags in admin settings

Instructions for check payments would save with <p> tags wrapping everything and show it in the admin textarea box after saving
@dparker1005
Copy link
Member

The Pay By Check Add On currently relies on the <p> tags being added to the setting, but I just opened a PR here to update PBC to use the same output code as core, which should resolve this issue and allow us to merge this PR:
strangerstudios/pmpro-pay-by-check#138

@andrewlimaza
Copy link
Contributor

This PR looks good, I ran a test to ensure HTML tags were still allowed since it's moving towards esc_textarea and not wp_kses_post. We should make the same change to Pay By Check Add On just to ensure there are no discrepancies - strangerstudios/pmpro-pay-by-check#138

I don't think people would be adding too much logic to the instructions, but keeping support for basic HTML is important.

@dparker1005 dparker1005 merged commit 0860a4e into strangerstudios:dev Mar 6, 2025
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.

Saving instructions for check method shows HTML in textarea after save
3 participants