Issue Bug Closed

#65666typolink, typolinkEnableLinksAcrossDomains and forceAbsoluteUrl strips absRefPrefix

Markus Klein 03/11/15, 15:15 updated 10/02/18, 11:45

Description

Environment

  • no realurl
  • config.typolinkEnableLinksAcrossDomains= 1
  • config.absRefPrefix = /site/

Reproduce

use this TypoScript snippet:

link = TEXT
link.typolink {
  parameter = 66
  forceAbsoluteUrl = 1
  additionalParams = &tx_ext_pi1[controller]=Controller
  returnLast = url
}

The expected result would be:
> http://dev/site/index.php?id=66&tx_ext_pi1%5Bcontroller%5D=Controller
The actual result is:
> http://dev/index.php?id=66&tx_ext_pi1%5Bcontroller%5D=Controller

Solution

In the typolink() function there is a wrong assumption about the content of $targetDomain.
> If we have domain here it means we link across domains…

If forceAbsoluteUrl is set $targetDomain will contain the current domain.
A check for this case needs to be added.

Reviews 2