impress-org / givewp-snippet-library

A collection of code snippets to enhance or expand on the free Give WordPress Donation Plugin.
https://givewp.com
140 stars 90 forks source link

Form Autopopulate Doesn't Decode Email Correctly #117

Closed JasonBroderick closed 4 years ago

JasonBroderick commented 4 years ago

User Story

As an admin I want to pass a URL encoded email address and have it correctly populate the email field in my Give forms, e.g using merge fields to pass email address to the form url from my email service provider.

Details

URLs with encoded email addresses do not correctly decode %40 as @ and so email fields are being populated incorrectly.

Example

example.com/donations/form/?email=JWayne%40wpimpress.com

Email: JWayne%40wpimpress.com

Expected Behavior

Email should be decoded correctly to:

JWayne@wpimpress.com

Steps to Reproduce

  1. After installing snippet, on any form url add the query param "?email=JWayne%40wpimpress.com"
  2. Skip to email field...
  3. See incorrect email, with %40 instead of @

Acceptance Criteria