[BUGFIX] Remove check for switching URL schemes 89/58089/2
authorBenni Mack <benni@typo3.org>
Thu, 30 Aug 2018 13:40:04 +0000 (15:40 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Thu, 30 Aug 2018 14:09:28 +0000 (16:09 +0200)
During the cleanup of https://review.typo3.org/#/c/58022/ a wrong
change was done, this actually introduces a regression showing that
the scheme part is never evaluated, removing the superfluos check now
completely.

Resolves: #86042
Related: #85964
Releases: master
Change-Id: I0e5a6f5d90141a86e34b4950ace36d620bee813f
Reviewed-on: https://review.typo3.org/58089
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php

index 63ed05f..e6781dd 100644 (file)
@@ -178,11 +178,8 @@ class PageLinkBuilder extends AbstractTypolinkBuilder
             if (isset($conf['forceAbsoluteUrl.']['scheme']) && $conf['forceAbsoluteUrl.']['scheme']) {
                 $absoluteUrlScheme = $conf['forceAbsoluteUrl.']['scheme'];
             }
-            // If no domain records are defined, use current domain:
-            $currentUrlScheme = parse_url(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'), PHP_URL_SCHEME);
-            if ($targetDomain === '' && $absoluteUrlScheme !== $currentUrlScheme) {
-                $targetDomain = $currentDomain;
-            }
+            // If no domain records are defined, use current domain
+            $targetDomain = $targetDomain ?: $currentDomain;
             // If go for an absolute link, add site path if it's not taken care about by absRefPrefix
             if (!$tsfe->absRefPrefix && $targetDomain === $currentDomain) {
                 $targetDomain = $currentDomain . rtrim(GeneralUtility::getIndpEnv('TYPO3_SITE_PATH'), '/');