summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortof <>2008-05-20 10:57:37 +0000
committertof <>2008-05-20 10:57:37 +0000
commit7c41a6bf7f922849d46bb41ac3e60077ee5f6adf (patch)
treeb1902d251654bed926c6c32fd85c99fdd5cf30de
parentf313138c9545d567d411e80aead77eb03c83ae25 (diff)
Fixed #847
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/THttpRequest.php11
2 files changed, 6 insertions, 6 deletions
diff --git a/HISTORY b/HISTORY
index 38f6c115..d90fa23a 100644
--- a/HISTORY
+++ b/HISTORY
@@ -2,6 +2,7 @@ Version 3.1.3 To Be Released
============================
BUG: Ticket#836 - TRatingList downgrade (Christophe)
BUG: Ticket#841 - Strange output from THttpResponse (Christophe)
+BUG: Ticket#847 - getBaseUrl sometimes fails (Christophe)
BUG: Ticket#843 - TDataList alternatinItem issue after changes in rev 2227 (Christophe)
BUG: Ticket#849 - TDatePicker selecting current date problem (Christophe)
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;
}
/**