[BUGFIX] Resolving the correct preview domain
authorThomas Layh <thomas@layh.com>
Wed, 7 Mar 2012 02:50:20 +0000 (03:50 +0100)
committerXavier Perseguers <xavier@typo3.org>
Sun, 11 Mar 2012 10:33:20 +0000 (11:33 +0100)
Since the patch #30892 the backend login domain has a higher priority
than the first domain in the rootline.

Changed this behavior to work like in the older TYPO3 version.

Change-Id: Ib6be760eb2707fb0fbf7b3b37464ba9ef9eab744
Fixes: #34698
Releases: 4.8, 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/9519
Reviewed-by: Philipp Gampe
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Wouter Wolters
t3lib/class.t3lib_befunc.php

index 25cd8ff..5fc8797 100644 (file)
@@ -2663,11 +2663,14 @@ final class t3lib_BEfunc {
                        if ($page['url_scheme'] == t3lib_utility_Http::SCHEME_HTTPS || ($page['url_scheme'] == 0 && t3lib_div::getIndpEnv('TYPO3_SSL'))) {
                                $protocol = 'https';
                        }
-                       $domainRecord = self::getDomainStartPage($urlParts['host'], $urlParts['path']);
-                       if ($domainRecord && isset($domainRecord['domainName'])) {
-                               $domain = $domainRecord['domainName'];
+
+                       $domainName = self::firstDomainRecord($rootLine);
+
+                       if ($domainName) {
+                               $domain = $domainName;
                        } else {
-                               $domain = self::firstDomainRecord($rootLine);
+                               $domainRecord = self::getDomainStartPage($urlParts['host'], $urlParts['path']);
+                               $domain = $domainRecord['domainName'];
                        }
 
                        if ($domain) {