[BUGFIX] Allow protocol in TCEMAIN.previewDomain 21/39521/4
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:30:39 +0000 (14:30 +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/39521
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Stephan GroƟberndt <stephan@grossberndt.de>
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Classes/Utility/BackendUtility.php

index 8204b0e..f698a07 100644 (file)
@@ -2866,7 +2866,11 @@ class BackendUtility {
                        }
                        $previewDomainConfig = static::getBackendUserAuthentication()->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);
                        }