Show
Ignore:
Timestamp:
05/20/2008 05:57:37 AM (6 months ago)
Author:
tof
Message:

Fixed #847

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/framework/Web/THttpRequest.php

    r2462 r2463  
    367367        public function getBaseUrl($forceSecureConnection=false) 
    368368        { 
    369                 $secure=$this->getIsSecureConnection() || $forceSecureConnection; 
    370                 $url=($secure ? "https://" : "http://") . $_SERVER ['HTTP_HOST']; 
    371                 $port=$_SERVER['SERVER_PORT']; 
    372                 if(($port!=80 && !$secure) || ($port!=443 && $secure)) 
    373                         $url.=':'.$port; 
    374                 return $url; 
     369                $url=$this->getUrl(); 
     370                $scheme=($forceSecureConnection)?"https":$url->getScheme(); 
     371                $host=$url->getHost(); 
     372                if (($port=$url->getPort())) $host.=':'.$port; 
     373                return $scheme.'://'.$host; 
    375374        } 
    376375