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

Fix trailing ampersands when empty array passed as query param #13461

Merged
merged 1 commit into from
Jan 22, 2019

Conversation

christianwach
Copy link
Member

Overview

Fixes this issue on Lab.

Additionally removes the incorrect parsing of any arrays passed as the $query param to CRM_Utils_System_WordPress::url(). The $query param should never be an array because this is handled by CRM_Utils_System::url() beforehand and CRM_Utils_System_WordPress::url() should never be called directly.

Before

Calling CRM_Utils_System::url() with params such as:

$url = CRM_Utils_System::url(
  'civicrm/some/path',
  array(), // This is the `$query` param
  TRUE,
  NULL,
  FALSE,
  TRUE
);

results in a URL of the form:

https://[domain]/civicrm/?page=CiviCRM&q=civicrm%2Fsome%2Fpath&

After

URLs no longer have the trailing ampersand:

https://[domain]/civicrm/?page=CiviCRM&q=civicrm%2Fsome%2Fpath

@civibot
Copy link

civibot bot commented Jan 15, 2019

(Standard links)

@civibot civibot bot added the master label Jan 15, 2019
@eileenmcnaughton
Copy link
Contributor

@kcristiano one for you - looks sensible to me

@kcristiano
Copy link
Member

@eileenmcnaughton It is sensible.

I've applied and run through some testing based upon the issue and related SE comments. I have not found any issues. I think it's good to merge.

@colemanw colemanw merged commit 6b9ac69 into civicrm:master Jan 22, 2019
@christianwach christianwach deleted the lab-666 branch January 22, 2019 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants