[BUGFIX] Properly handle absolute links in typolink() 33/37733/2
authorMarkus Klein <klein.t3@reelworx.at>
Wed, 11 Mar 2015 14:17:52 +0000 (15:17 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Wed, 11 Mar 2015 14:40:29 +0000 (15:40 +0100)
Fix a wrong assumption in the code that claims we link across domains.
If config.forceAbsoluteUrl is set, we might link to the same domain.

The patch adds a check, such that the assumption is correct afterwards.

Resolves: #65666
Releases: master, 6.2
Change-Id: I5a26522c625303637dee91a23dbf902f86a20bed
Reviewed-on: http://review.typo3.org/37733
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index be22890..a83e167 100644 (file)
@@ -6099,7 +6099,7 @@ class ContentObjectRenderer {
                                                        $LD = $GLOBALS['TSFE']->tmpl->linkData($page, $target, $conf['no_cache'], '', '', $addQueryParams, $theTypeP, $targetDomain);
                                                        if (strlen($targetDomain)) {
                                                                // We will add domain only if URL does not have it already.
-                                                               if ($enableLinksAcrossDomains) {
+                                                               if ($enableLinksAcrossDomains && $targetDomain !== $currentDomain) {
                                                                        // Get rid of the absRefPrefix if necessary. absRefPrefix is applicable only
                                                                        // to the current web site. If we have domain here it means we link across
                                                                        // domains. absRefPrefix can contain domain name, which will screw up