* Fixed problem with domain look-up when an extra "/" was added to eg. "typo3.com...
authorKasper Skårhøj <kasper@typo3.org>
Thu, 1 Apr 2004 16:06:18 +0000 (16:06 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Thu, 1 Apr 2004 16:06:18 +0000 (16:06 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@186 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_page.php
typo3/sysext/cms/tslib/class.tslib_fe.php

index 6809237..3384dc1 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2004-04-01  Kasper Skårhøj,,,  <kasper@typo3.com>
 
+       * Fixed problem with domain look-up when an extra "/" was added to eg. "typo3.com//" -> showing "typo3.org" instead
+
+2004-04-01  Kasper Skårhøj,,,  <kasper@typo3.com>
+
        * Fixed some browser detection bugs in t3lib_matchcondition and t3lib_div. Not necessarily exhaustive! For instance a report on Netscape 7.2 being wrongly detected may not be resolved (need teh value of HTTP_USER_AGENT to solve it since I do not have netscape 7.2!)
 
 2004-04-01  Kasper Skårhøj,,,  <kasper@typo3.com>
index 2e424ea..edd60e6 100755 (executable)
@@ -50,7 +50,7 @@
  *
  *              SECTION: Page related: Menu, Domain record, Root line
  *  296:     function getMenu($uid,$fields='*',$sortField='sorting',$addWhere='')      
- *  315:     function getDomainStartPage($domain, $path='',$request_uri='')    
+ *  315:     function getDomainStartPage($domain, $path='',$request_uri='')
  *  361:     function getRootLine($uid, $MP='')        
  *  421:     function getPathFromRootline($rl,$len=20) 
  *  442:     function getExtURL($pagerow,$disable=0)
@@ -318,8 +318,9 @@ class t3lib_pageSelect {
                        // Removing extra trailing slashes
                $path = trim(ereg_replace('\/[^\/]*$','',$path));
                        // Appending to domain string
-               $domain.=$path;
-               
+               $domain.= $path;
+               $domain = ereg_replace('\/*$','',$domain);
+
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
                                        'pages.uid,sys_domain.redirectTo,sys_domain.prepend_params', 
                                        'pages,sys_domain', 
index ebbbffe..eb165d0 100755 (executable)
@@ -60,7 +60,7 @@
  *  904:     function checkPagerecordForIncludeSection($row)   
  *  916:     function setIDfromArgV()  
  *  932:     function getPageAndRootlineWithDomain($domainStartPage)   
- *  960:     function findDomainRecord($recursive=0)   
+ *  960:     function findDomainRecord($recursive=0)
  *  981:     function pageNotFoundHandler($code,$header='')    
  * 1003:     function checkAndSetAlias()       
  * 1018:     function idPartsAnalyze($str)     
                if ($recursive) {
                        $host = explode('.',t3lib_div::getIndpEnv('HTTP_HOST'));
                        while(count($host))     {
-                               $pageUid = $this->sys_page->getDomainStartPage(implode('.',$host),t3lib_div::getIndpEnv('SCRIPT_NAME'),t3lib_div::getIndpEnv('REQUEST_URI'));   
+                               $pageUid = $this->sys_page->getDomainStartPage(implode('.',$host),t3lib_div::getIndpEnv('SCRIPT_NAME'),t3lib_div::getIndpEnv('REQUEST_URI'));
                                if ($pageUid)   return $pageUid; else array_shift($host);
                        }
                        return $pageUid;