[BUGFIX] For links across domains check if absRefPrefix is set 79/56079/2
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Fri, 9 Mar 2018 16:42:27 +0000 (17:42 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Mon, 12 Mar 2018 12:50:47 +0000 (13:50 +0100)
Prevent PHP-error if absRefPrefix is not set.

Resolves: #84188
Releases: master, 8.7
Change-Id: Ic04184554281cdcaa74037290930aa0110696a07
Reviewed-on: https://review.typo3.org/56079
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Wolfgang Klinger <wolfgang@wazum.com>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php

index 3f7e539..be1cbb8 100644 (file)
@@ -193,7 +193,7 @@ class PageLinkBuilder extends AbstractTypolinkBuilder
             $LD = $tsfe->tmpl->linkData($page, $target, $conf['no_cache'], '', '', $addQueryParams, $pageType, $targetDomain);
             if ($targetDomain !== '') {
                 // We will add domain only if URL does not have it already.
-                if ($enableLinksAcrossDomains && $targetDomain !== $currentDomain) {
+                if ($enableLinksAcrossDomains && $targetDomain !== $currentDomain && isset($tsfe->config['config']['absRefPrefix'])) {
                     // 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