Bug #22065
closedMultiple domain on the same page enable crossdomain linking wrongly
0%
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)