summaryrefslogtreecommitdiff
path: root/framework/Web/THttpRequest.php
diff options
context:
space:
mode:
authorxue <>2006-06-19 18:38:29 +0000
committerxue <>2006-06-19 18:38:29 +0000
commit588727c7e2b8954ec3dbde293cf4c4d68b119f9b (patch)
treefdcc16181a20335547953ccf1550e0006c11bf28 /framework/Web/THttpRequest.php
parent127f78a4db3cc0fbbbb92f5b1abcfdce4a9af93b (diff)
Merge from 3.0 branch till 1185.
Diffstat (limited to 'framework/Web/THttpRequest.php')
-rw-r--r--framework/Web/THttpRequest.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/framework/Web/THttpRequest.php b/framework/Web/THttpRequest.php
index 4e04ecca..b908db53 100644
--- a/framework/Web/THttpRequest.php
+++ b/framework/Web/THttpRequest.php
@@ -259,7 +259,7 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar
*/
public function getIsSecureConnection()
{
- return !empty($_SERVER['HTTPS']);
+ return isset($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'],'off');
}
/**
@@ -287,6 +287,14 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar
}
/**
+ * @return string schema and hostname of the requested URL
+ */
+ public function getBaseUrl()
+ {
+ return ($this->getIsSecureConnection() ? "https://" : "http://") . $_SERVER ['HTTP_HOST'];
+ }
+
+ /**
* @return string entry script URL (w/o host part)
*/
public function getApplicationUrl()
@@ -295,6 +303,14 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar
}
/**
+ * @return string entry script URL (w/ host part)
+ */
+ public function getAbsoluteApplicationUrl()
+ {
+ return $this->getBaseUrl() . $this->getApplicationUrl();
+ }
+
+ /**
* @return string application entry script file path (processed w/ realpath())
*/
public function getApplicationFilePath()