Bug #19149
closedInter domain linking with typolinkEnableLinksAcrossDomains does not work for domain record on root page
0%
Description
Considering the following setup with multiple domains:
+ root (domain A, siteroot)
|
-- Subsite (domain B, siteroot)
| |
| -- Subpage
|
-- Some Page
|
-- Other Page
Even with typolinkEnableLinksAcrossDomains enabled, the links from the Subsite (domain B) back to domain A don't work.
In class.tslib_content.php (5324) there is a check, if the linked page shares a root page with the current page. It does! The newly added if for is_siteroot is not considered, because it is checked after the rootline. So the domain record for domain A will not be used!
I think a setup like the one mentioned above is quite common and desirable. Swapping the two if-statements solves the problem. But now for every link from a page in domain A to another page in domain A the domain record will be found, so it must be checked if adding the domain is necessary in the URL.
class.tslib_content.php (5324):
if ($tCR_data['is_siteroot']) {
// Possibly subdomain inside main domain. In any case we must stop now because site root is reached.
break;
}
if ($tCR_data['uid'] == $GLOBALS['TSFE']->tmpl->rootLine0['uid']) {
$tCR_flag = 1; // OK, it was in rootline!
break;
}
Don't generate unnecessary absolute urls:
class.tslib_content.php (5364):
if ($urlParts['host'] == '' && (t3lib_div::getIndpEnv('HTTP_HOST') != $tCR_domain)) {
$LD['totalURL'] = 'http://' . $tCR_domain . ($LD['totalURL']{0} == '/' ? '' : '/') . $LD['totalURL'];
}
(issue imported from #M9046)
Files