Project

General

Profile

Actions

Bug #22065

closed

Multiple domain on the same page enable crossdomain linking wrongly

Added by Romain Leleu about 14 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-02-05
Due date:
% Done:

0%

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

Description

Hello,

In my setup I've multiple domain on the same page.:
dev.xxxxxx.com
preprod.xxxxxx.com
www.xxxxxx.com

When creating a typolink it use the first listed domain. So going on the website with www.xxxxx.com while having dev.xxxx.com as the first domain will enable cross domain linking.

Of course I could change order but in some situation it's not possible. for example if a website must be reachable at the same time from internal and external adress like: site.local.lan and site.demo.mycompany.com

It seems that the bug come from typolink function in tslib_content.php. Starting from 4.3.0 code changed a lot.

In 4.3.1, on line 6075 I replaced:
if (!isset($foundDomains[$row['pid']])) {

by
if (!isset($foundDomains[$row['pid']]) || $row['domainName'] == $currentDomain) {

This way, if more than one domain is available on the same page, the current domain name will be prefered.
BE admin are still able to user the "force" field on a domain to force it.
(issue imported from #M13436)

Actions #1

Updated by Romain Leleu about 14 years ago

Sorry, i posted report in the wrong project. It should be a TYPO3 4.3 report.

I'll post it in the right project.

Actions #2

Updated by Tobias almost 14 years ago

so... editing the core is the only solution? Will this be solved in future versions? The problem still occurs in 4.3.3.

thx

Actions #3

Updated by Chris topher almost 14 years ago

Hi guys,

TYPO3 is community driven. That means there is no "paid team" which has to fix problems.

If you find a problem and maybe even a solution for that, you should provide a patch. To get this in the next releases, please post it in the TYPO3-Core-list.
Check out http://typo3.org/teams/core/core-mailinglist-rules

Actions #4

Updated by Dmitry Dulepov over 12 years ago

  • Status changed from New to Closed
  • Target version deleted (0)

Not reproducible any more. I believe the following code line solves the issue already:

if (count($foundDomains) > 0 && (!in_array($currentDomain, $foundDomains) || count($firstFoundForcedDomains) > 0)) {
Actions

Also available in: Atom PDF