* Fixed bug #7991: Workspace Preview is not aware of domain records
authorMichael Stucki <michael.stucki@typo3.org>
Thu, 3 Apr 2008 22:09:52 +0000 (22:09 +0000)
committerMichael Stucki <michael.stucki@typo3.org>
Thu, 3 Apr 2008 22:09:52 +0000 (22:09 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3526 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_befunc.php

index fb4ce11..24ae1af 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,7 @@
 2008-04-03  Sebastian Kurfuerst  <sebastian@typo3.org>
 
        * Fixed bug #7476: link in about module opens in the TYPO3 backend frameset (Thanks to Bodo Eichst√§dt / wmdb)
+       * Fixed bug #7991: Workspace Preview is not aware of domain records
 
 2008-04-02  Ingo Renner  <ingo@typo3.org>
 
index 2abc736..d20e3de 100755 (executable)
@@ -2519,19 +2519,17 @@ final class t3lib_BEfunc {
                if ($altUrl) {
                        $url = $altUrl;
                } else {
-
-                       if ($GLOBALS['BE_USER']->workspace!=0 && !$GLOBALS['BE_USER']->user['workspace_preview']) {
-                               $url = t3lib_div::getIndpEnv('TYPO3_SITE_URL').TYPO3_mainDir.'mod/user/ws/wsol_preview.php?id='.$id.$addGetVars.$anchor;
-                       } else {
-                               if ($rootLine) {
-                                       $parts = parse_url(t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
-                                       if (t3lib_BEfunc::getDomainStartPage($parts['host'], $parts['path'])) {
-                                               $preUrl_temp = t3lib_BEfunc::firstDomainRecord($rootLine);
-                                       }
+                               // check where to render the page
+                       $viewScript = ($GLOBALS['BE_USER']->workspace!=0 && !$GLOBALS['BE_USER']->user['workspace_preview']) ? '/'.TYPO3_mainDir.'mod/user/ws/wsol_preview.php?id=' : '/index.php?id=';
+                               // check alternate Domains
+                       if ($rootLine)  {
+                               $parts = parse_url(t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
+                               if (t3lib_BEfunc::getDomainStartPage($parts['host'],$parts['path']))    {
+                                       $preUrl_temp = t3lib_BEfunc::firstDomainRecord($rootLine);
                                }
-                               $preUrl = $preUrl_temp ? (t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://').$preUrl_temp : $backPath.'..';
-                               $url = $preUrl.'/index.php?id='.$id.$addGetVars.$anchor;
                        }
+                       $preUrl = $preUrl_temp ? (t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://').$preUrl_temp : $backPath.'..';
+                       $url = $preUrl.$viewScript.$id.$addGetVars.$anchor;
                }
 
                return "previewWin=window.open('".$url."','newTYPO3frontendWindow');".