-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Pass path through rawurlencode when not using CIVICRM_CLEANURL #13043
Conversation
(Standard links)
|
I tested this pr by following the documentation in https://lab.civicrm.org/dev/wordpress/issues/12 and was able to view the thank you page for a contribution form shortcode on the homepage!!!! Thank you @christianwach and @kcristiano This is ready to be merged from my perspective (not sure if the failing check is related). |
test this please |
@christianwach @kcristiano this only touches WP so you should be the arbiters of it. If you feel it is mergeable but are just waiting on tests then add the 'merge on pass' label & someone will merge it when they notice the green tick. |
also I should note that I've seen the emails flying by on this issue & it really seems a great example of open source at it's finest - the 3 of you have collaborated with impressive speed & effectiveness on this |
@eileenmcnaughton I can't add labels on this repo or I would set it merge on pass |
OK I added it - @totten I thought they were also going to be mergers on this repo (with the understanding they were merging WP code) |
merging as per the tag |
@christianwach Take a look at https://lab.civicrm.org/dev/rc/issues/1#note_10697 This PR appears to create a regression in creating a new Contribution Page. |
@kcristiano It's definitely not a regression - it has brought an additional bug to the surface. Please see my analysis on https://lab.civicrm.org/dev/wordpress/issues/12#note_10709 |
thanks @christianwach for the quick analysis |
Overview
Fixes https://lab.civicrm.org/dev/wordpress/issues/12
Before
CiviCRM does not generate valid URLs when
CIVICRM_CLEANURL
is off. This means URLs of the form:that CiviCRM uses on the front-end.
What happens when a shortcode is used on the home page is that this URL is caught by
redirect_canonical
on thetemplate_redirect
hook and redirected to a rebuilt URL (where whereq
is urlencoded) that looks like this:but, crucially, not before CiviCRM has sent the confirmation email and cleared the session. This causes the next page load to trigger
invalidKeyRedirect
and thus causes an infinite redirect. This does not happen on other pages because of the logic inredirect_canonical
.After
All relevant URLs are appropriately urlencoded in the form:
No redirection is made by
redirect_canonical
.Technical Details
N/A
Comments
You may notice that this PR makes provision for a future where it is possible to allow Clean URLs in WordPress. The code to enable this is forthcoming in the CiviCRM WordPress repo - but since that code is dependent on #12969 and these changes to
url()
, it makes sense for this PR to include those changes here.