Fixed bug #3491: Linking between domains in the pagetree ignores simulate static...
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Tue, 19 Feb 2008 07:40:21 +0000 (07:40 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Tue, 19 Feb 2008 07:40:21 +0000 (07:40 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3228 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_content.php
typo3/sysext/cms/tslib/class.tslib_fe.php

index a527fea..c0f3362 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-19  Dmitry Dulepov  <dmitry@typo3.org>
+
+       * Fixed bug #3491: Linking between domains in the pagetree ignores simulate static documents
+
 2008-02-19  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
 
        * Fixed bug #7583: htmlArea RTE should allow to markup text in absence of any block element
index 3d18057..42d0074 100755 (executable)
@@ -5284,7 +5284,7 @@ class tslib_cObj {
                                                        // Add "&MP" var:
                                                        $addQueryParams.= '&MP='.rawurlencode(implode(',',$MPvarAcc));
                                                }
-                                               elseif ($GLOBALS['TSFE']->config['config']['typolinkCheckRootline'])    {
+                                               elseif ($GLOBALS['TSFE']->config['config']['typolinkCheckRootline']) {
                                                        // This checks if the linked id is in the rootline of this site and if not it will find the domain for that ID and prefix it:
                                                        $tCR_rootline = $GLOBALS['TSFE']->sys_page->getRootLine($page['uid']);  // Gets rootline of linked-to page
                                                        $tCR_flag = 0;
@@ -5307,15 +5307,20 @@ class tslib_cObj {
                                                        }
                                                }
                                                        // If other domain, overwrite
-                                               if (strlen($tCR_domain))        {
+                                               if (strlen($tCR_domain) && !$GLOBALS['TSFE']->config['config']['typolinkEnableLinksAccrosDomains']) {
                                                        $target = isset($conf['extTarget']) ? $conf['extTarget'] : $GLOBALS['TSFE']->extTarget;
                                                        if ($conf['extTarget.'])        {$target = $this->stdWrap($target, $conf['extTarget.']);}
                                                        if ($forceTarget)       {$target=$forceTarget;}
                                                        $LD['target'] = $target;
                                                        $this->lastTypoLinkUrl = $this->URLqMark('http://'.$tCR_domain.'/index.php?id='.$page['uid'],$addQueryParams).$sectionMark;
                                                } else {        // Internal link:
-                                                       if ($forceTarget)       {$target=$forceTarget;}
+                                                       if ($forceTarget) {
+                                                               $target=$forceTarget;
+                                                       }
                                                        $LD = $GLOBALS['TSFE']->tmpl->linkData($page,$target,$conf['no_cache'],'','',$addQueryParams,$theTypeP);
+                                                       if (strlen($tCR_domain)) {
+                                                               $LD['totalURL'] = 'http://' . $tCR_domain . ($LD['totalURL']{0} == '/' ? '' : '/') . $LD['totalURL'];
+                                                       }
                                                        $this->lastTypoLinkUrl = $this->URLqMark($LD['totalURL'],'').$sectionMark;
                                                }
 
index bc8b876..6e4d2dd 100755 (executable)
@@ -1562,7 +1562,7 @@ require_once (PATH_t3lib.'class.t3lib_lock.php');
                                        }
                                } else {
                                        $message = 'You logged out from Workspace preview mode. Click this link to <a href="%1$s">go back to the website</a>';
-                               } 
+                               }
                                die(sprintf($message,
                                        htmlspecialchars(ereg_replace('\&?ADMCMD_prev=[[:alnum:]]+','',t3lib_div::_GET('returnUrl')))
                                        ));
@@ -1942,6 +1942,10 @@ require_once (PATH_t3lib.'class.t3lib_lock.php');
                                                $this->setSimulReplacementChar();
                                        }
 
+                                       if ($this->config['config']['typolinkEnableLinksAccrosDomains']) {
+                                               $this->config['config']['typolinkCheckRootline'] = true;
+                                       }
+
                                                // Set default values for removeDefaultJS, inlineStyle2TempFile and minifyJS so CSS and JS are externalized/minified if compatversion is higher than 4.0
                                        if (t3lib_div::compat_version('4.0')) {
                                                if (!isset($this->config['config']['removeDefaultJS'])) {