From 7c41a6bf7f922849d46bb41ac3e60077ee5f6adf Mon Sep 17 00:00:00 2001 From: tof <> Date: Tue, 20 May 2008 10:57:37 +0000 Subject: Fixed #847 --- framework/Web/THttpRequest.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'framework') diff --git a/framework/Web/THttpRequest.php b/framework/Web/THttpRequest.php index 23ab26ec..d1fc7a60 100644 --- a/framework/Web/THttpRequest.php +++ b/framework/Web/THttpRequest.php @@ -366,12 +366,11 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar */ public function getBaseUrl($forceSecureConnection=false) { - $secure=$this->getIsSecureConnection() || $forceSecureConnection; - $url=($secure ? "https://" : "http://") . $_SERVER ['HTTP_HOST']; - $port=$_SERVER['SERVER_PORT']; - if(($port!=80 && !$secure) || ($port!=443 && $secure)) - $url.=':'.$port; - return $url; + $url=$this->getUrl(); + $scheme=($forceSecureConnection)?"https":$url->getScheme(); + $host=$url->getHost(); + if (($port=$url->getPort())) $host.=':'.$port; + return $scheme.'://'.$host; } /** -- cgit v1.2.3