Project

General

Profile

Actions

Bug #19149

closed

Inter domain linking with typolinkEnableLinksAcrossDomains does not work for domain record on root page

Added by Christopher Hlubek over 16 years ago. Updated almost 15 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Communication
Target version:
-
Start date:
2008-07-25
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

0009046_v4.patch (5.29 KB) 0009046_v4.patch Administrator Admin, 2009-03-30 09:47
patch_9046_v5.patch (8.05 KB) patch_9046_v5.patch Administrator Admin, 2009-08-31 22:37
patch_9046_v9.patch (7.98 KB) patch_9046_v9.patch Administrator Admin, 2009-11-02 12:18
patch_9046_v8b_cacheIssue.patch (756 Bytes) patch_9046_v8b_cacheIssue.patch Administrator Admin, 2009-11-02 12:18
patch_9046_v11.patch (7.74 KB) patch_9046_v11.patch Administrator Admin, 2009-11-06 17:53
patch_9046_v10b_cacheIssue.patch (774 Bytes) patch_9046_v10b_cacheIssue.patch Administrator Admin, 2009-11-06 17:53

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #22321: typoLink() always creates absolute links when using more than one domain recordsClosedTobias Liebig2010-03-24

Actions
Actions #1

Updated by Tobias Liebig about 15 years ago

attached patch (_v5) is pending in core list.

Caching issue must be solved: We need to add the HTTP_HOST to the caching identifier

Actions #2

Updated by Ernesto Baschny about 15 years ago

I wouldn't do that, Tobi, as HTTP_HOST comes from the user and cannot be trusted.

Rather I would drop the dependency on HTTP_HOST to decide if we need a domain prepended or not. See my post in the core list about that.

Actions #3

Updated by Tobias Liebig about 15 years ago

attached the current revision (pending in corelist) of the patches.

Using the HTTP_HOST in the cache identifier is indeed no good idea.
patch_9046_v8b_cacheIssue.patch solves the caching issue by using the domainStartPage (id where the domainrecord lies).

Actions #4

Updated by Tobias Liebig about 15 years ago

commited in r6359

Actions

Also available in: Atom PDF