Changeset 2463

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

Fixed #847

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/HISTORY

    r2462 r2463  
    33BUG: Ticket#836 - TRatingList downgrade (Christophe) 
    44BUG: Ticket#841 - Strange output from THttpResponse (Christophe) 
     5BUG: Ticket#847 - getBaseUrl sometimes fails (Christophe) 
    56BUG: Ticket#843 - TDataList alternatinItem issue after changes in rev 2227 (Christophe) 
    67BUG: Ticket#849 - TDatePicker selecting current date problem (Christophe) 
  • 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