impress-org / givewp

GiveWP - The #1 Donation Plugin for WordPress. Easily accept donations and fundraise using your WordPress website.
https://givewp.com/
GNU General Public License v3.0
345 stars 191 forks source link

[Preview email] should... #6502

Closed Genevieve-K closed 2 years ago

Genevieve-K commented 2 years ago

User Story

As an admin, I want to preview emails with a donation ID and there is an error.

Details

On the email list, I want to preview an email. I see the email no associated to a donation. I choose a donation, and there is the error, the session is not recognized.

Expected Behavior

The email must be displayed for a donation.

Steps to Reproduce

  1. Go to Settings > Emails
  2. Choose an email(e.g. Donation Receipt) and click Preview
  3. Select a donation to preview
  4. Error: We're unable to recognize your session. Please refresh the screen to try again; otherwise contact your website administrator for assistance.

Visuals

image

Additional Context

The URL is escaped, The '&' are replaced by '&' and the nonce is not regognized. Example with localhost: Escaped URL: https://localhost/test-give/?give_action=preview_email&email_type=donation-receipt&_wpnonce=cdfe35823e&preview_id=134 Expected URL: https://localhost/test-give?give_action=preview_email&email_type=donation-receipt&_wpnonce=cdfe35823e&preview_id=134

JasonTheAdams commented 2 years ago

Hi @Genevieve-K!

Thank you for reporting this! I just threw together a PR to fix this: https://github.com/impress-org/givewp/pull/6508

Would you be so kind as to test that and make sure it resolves the issue for you as well? You can also download a zip here if you'd prefer to do that: https://github.com/impress-org/givewp/actions/runs/2619432075

Much appreciated!

Genevieve-K commented 2 years ago

Hi @JasonTheAdams, I replaced 'esc_url' bay 'esc_url_raw' in the four files. It works! Thank you.

JoshuaHungDinh commented 2 years ago

Resolved in https://github.com/impress-org/givewp/pull/6508.