[BUGFIX] Allow protocol in TCEMAIN.previewDomain 42/39542/2
authorWouter Wolters <typo3@wouterwolters.nl>
Wed, 13 May 2015 08:16:24 +0000 (10:16 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Thu, 14 May 2015 12:32:41 +0000 (14:32 +0200)
If a backend uses https as protocol and the installation
is a muti domain installation, the https protocol can lead
to problems with previewing, when other domains don't support https.

Fix this by allowing a protocol to be set in TCEMAIN.previewDomain

Resolves: #62129
Releases: master,6.2
Change-Id: Ifffef57ff8a535aedb2141f0e3cbf01b1d8baac6
Reviewed-on: http://review.typo3.org/39542
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Classes/Utility/BackendUtility.php

index f98a1d9..a3d84cb 100644 (file)
@@ -2803,7 +2803,11 @@ class BackendUtility {
                        }
                        $previewDomainConfig = $GLOBALS['BE_USER']->getTSConfig('TCEMAIN.previewDomain', self::getPagesTSconfig($pageId));
                        if ($previewDomainConfig['value']) {
-                               $domainName = $previewDomainConfig['value'];
+                               if (strpos($previewDomainConfig['value'], '://') !== FALSE) {
+                                       list($protocol, $domainName) = explode('://', $previewDomainConfig['value']);
+                               } else {
+                                       $domainName = $previewDomainConfig['value'];
+                               }
                        } else {
                                $domainName = self::firstDomainRecord($rootLine);
                        }