Skip to content

Commit

Permalink
dev/core#1637 regression fix on WP urls #16713
Browse files Browse the repository at this point in the history
PR @eileenmcnaughton civicrm/civicrm-core#16713
Overview
Reverts a change in 5.23 that is causing url breakage on WP when clean urls are not enabled (https://lab.civicrm.org/dev/core/issues/1637) and possibly Joomla but
still checking that (https://lab.civicrm.org/dev/financial/issues/120)

Before
Generated url is
/wp-admin/admin.php/?page=CiviCRM&q=civicrm%2Fupgrade%2Fqueue%2Fajax%2FrunNext

After
Generated url is /wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fupgrade%2Fqueue%2Fajax%2FrunNext

Technical Details
Revert "Make $civicrm_paths less sensitive to trailing slashes. Add t…ests."

This is currently causing breakage on wordpress sites where clean urls are not enabled.

Compare the 2 urls below - the top one has an extra (breaking) slash added by this PR.

I propose a quick revert & patch release followed by 'the right' fix at a slower pace
/wp-admin/admin.php/?page=CiviCRM&q=civicrm%2Fupgrade%2Fqueue%2Fajax%2FrunNext
/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fupgrade%2Fqueue%2Fajax%2FrunNext

This reverts commit 232fdd3.

This is the relevant line https://github.com/civicrm/civicrm-core/pull/16404/files#diff-1544096e8e60bfe9fe73eeca2844804eR223
  • Loading branch information
kcristiano committed Mar 9, 2020
1 parent 8e5d815 commit e6cb20f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion civicrm/Civi/Core/Paths.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public function getUrl($value, $preferFormat = 'relative', $ssl = NULL) {
return $value;
}

$value = rtrim($this->getVariable($defaultContainer, 'url'), '/') . '/' . $value;
$value = $this->getVariable($defaultContainer, 'url') . $value;

if ($preferFormat === 'relative') {
$parsed = parse_url($value);
Expand Down

0 comments on commit e6cb20f

Please sign in to comment.