[BUGFIX] previewLink generation is broken without domain-record
authorSteffen Ritter <info@rs-websystems.de>
Tue, 28 Feb 2012 20:51:01 +0000 (21:51 +0100)
committerOliver Hader <oliver@typo3.org>
Tue, 28 Feb 2012 21:18:35 +0000 (22:18 +0100)
Using the previewLink on pages within the backend on a branch
without a domain record defined, the link generation fails.

Therefore the opened window calls URL http://index.php?...

Change-Id: Icf3ff7087776fa4130316073446d983dd3be1026
Fixes: #34396
Releases: 4.5, 4.6, 4.7
Reviewed-on: http://review.typo3.org/9281
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
t3lib/class.t3lib_befunc.php

index 37577ac..4934308 100644 (file)
@@ -2675,7 +2675,12 @@ final class t3lib_BEfunc {
                        } else {
                                $domain = self::firstDomainRecord($rootLine);
                        }
-                       $domain = $protocol . '://' . $domain;
+
+                       if ($domain) {
+                               $domain = $protocol . '://' . $domain;
+                       } else {
+                               $domain = rtrim(t3lib_div::getIndpEnv('TYPO3_SITE_URL'), '/');
+                       }
                }
 
                return $domain;