Fix malformed redirect URLs
This is a bit of an edge case, but I have run into it once or twice. The perform
method of CRM_Core_QuickForm_Action_Jump
can produce invalid URLs. This happens when $current->getAttribute('action')
is a URL ending in ?
. The resulting URL has ?&
in it, e.g.
https://civicrm.latest/civicrm/event/register/?&_qf_ThankYou_display=true&qfKey=<some-key>
This seems to cause Chrome to "fix" the URL and then redirect to the "fixed" URL:
https://civicrm.latest/civicrm/event/register/?_qf_ThankYou_display=true&qfKey=<some-key>
I'm not certain about this - particularly as I haven't tested in all browsers - but this redirect could be the cause of missing sessions in the Event Registration process. If the "fix" behaviour changed from browser to browser, this might also account for the slipperiness of repeating the issue.
Either way, the method shouldn't produce invalid URLs.