[BUGFIX] Properly handle absolute links in typolink() 30/37730/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:39:54 +0000 (15:39 +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/37730
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Tested-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>

index 25fa9ab..dd1eb01 100644 (file)
@@ -6345,7 +6345,7 @@ class ContentObjectRenderer {
                                                        $LD = $GLOBALS['TSFE']->tmpl->linkData($page, $target, $conf['no_cache'], '', '', $addQueryParams, $theTypeP, $targetDomain);
                                                        if ($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