Skip to content
Snippets Groups Projects
Unverified Commit f1220bdb authored by Seamus Lee's avatar Seamus Lee Committed by GitHub
Browse files

Merge pull request #17773 from seamuslee001/5.27

Ensure that when normal routing trackable urls and opens in Joomla go to the frontend not administrator site
parents c8eedac8 f38a9ab0
Branches
Tags
No related merge requests found
......@@ -272,7 +272,7 @@ class CRM_Utils_System {
}
$config = CRM_Core_Config::singleton();
$url = $config->userSystem->url($path, $query, $absolute, $fragment, $frontend, $forceBackend);
$url = $config->userSystem->url($path, $query, $absolute, $fragment, $frontend, $forceBackend, $htmlize);
if ($htmlize) {
$url = htmlentities($url);
......@@ -333,7 +333,7 @@ class CRM_Utils_System {
* @return \Psr\Http\Message\UriInterface
*/
$mkRouteUri = function ($path, $query) use ($e) {
$urlTxt = CRM_Utils_System::url($path, $query, $e->absolute, $e->fragment, FALSE);
$urlTxt = CRM_Utils_System::url($path, $query, $e->absolute, $e->fragment, FALSE, TRUE);
if ($e->isSSL || ($e->isSSL === NULL && \CRM_Utils_System::isSSL())) {
$urlTxt = str_replace('http://', 'https://', $urlTxt);
}
......
......@@ -124,6 +124,8 @@ abstract class CRM_Utils_System_Base {
* This link should be to the CMS front end (applies to WP & Joomla).
* @param bool $forceBackend
* This link should be to the CMS back end (applies to WP & Joomla).
* @param bool $htmlize
* Whether to encode special html characters such as &.
*
* @return string
*/
......@@ -133,7 +135,8 @@ abstract class CRM_Utils_System_Base {
$absolute = FALSE,
$fragment = NULL,
$frontend = FALSE,
$forceBackend = FALSE
$forceBackend = FALSE,
$htmlize = TRUE
) {
return NULL;
}
......
......@@ -280,7 +280,8 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase {
$absolute = FALSE,
$fragment = NULL,
$frontend = FALSE,
$forceBackend = FALSE
$forceBackend = FALSE,
$htmlize = TRUE
) {
$query = html_entity_decode($query);
......
......@@ -153,7 +153,8 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base {
$absolute = FALSE,
$fragment = NULL,
$frontend = FALSE,
$forceBackend = FALSE
$forceBackend = FALSE,
$htmlize = TRUE
) {
$config = CRM_Core_Config::singleton();
$script = 'index.php';
......
......@@ -239,7 +239,8 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base {
$absolute = FALSE,
$fragment = NULL,
$frontend = FALSE,
$forceBackend = FALSE
$forceBackend = FALSE,
$htmlize = TRUE
) {
$config = CRM_Core_Config::singleton();
$separator = '&';
......
......@@ -43,7 +43,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base {
/**
* @inheritDoc
*/
public function url($path = NULL, $query = NULL, $absolute = TRUE, $fragment = NULL) {
public function url($path = NULL, $query = NULL, $absolute = TRUE, $fragment = NULL, $frontend = FALSE, $forceBackend = FALSE, $htmlize = TRUE) {
if (isset(self::$ufClass)) {
$className = self::$ufClass;
$url = $className::url($path, $query, $absolute, $fragment);
......
......@@ -75,9 +75,9 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Base {
$query = NULL,
$absolute = FALSE,
$fragment = NULL,
$htmlize = TRUE,
$frontend = FALSE,
$forceBackend = FALSE
$forceBackend = FALSE,
$htmlize = TRUE
) {
$config = CRM_Core_Config::singleton();
static $script = 'index.php';
......@@ -92,7 +92,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Base {
}
$base = $absolute ? $config->userFrameworkBaseURL : $config->useFrameworkRelativeBase;
$separator = $htmlize ? '&' : '&';
$separator = ($htmlize && $frontend) ? '&' : '&';
if (!$config->cleanURL) {
if (isset($path)) {
......
......@@ -265,7 +265,8 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
$absolute = FALSE,
$fragment = NULL,
$frontend = FALSE,
$forceBackend = FALSE
$forceBackend = FALSE,
$htmlize = TRUE
) {
$config = CRM_Core_Config::singleton();
$script = '';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment