summaryrefslogtreecommitdiff
path: root/framework/Web/THttpResponse.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/THttpResponse.php
parent127f78a4db3cc0fbbbb92f5b1abcfdce4a9af93b (diff)
Merge from 3.0 branch till 1185.
Diffstat (limited to 'framework/Web/THttpResponse.php')
-rw-r--r--framework/Web/THttpResponse.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php
index 0c9406c4..e44d6cba 100644
--- a/framework/Web/THttpResponse.php
+++ b/framework/Web/THttpResponse.php
@@ -307,12 +307,15 @@ class THttpResponse extends TModule implements ITextWriter
/**
* Redirects the browser to the specified URL.
* The current application will be terminated after this method is invoked.
- * @param string URL to be redirected to
+ * @param string URL to be redirected to. If the URL is a relative one, the base URL of
+ * the current request will be inserted at the beginning.
*/
public function redirect($url)
{
if(!$this->getApplication()->getRequestCompleted())
$this->getApplication()->onEndRequest();
+ if($url[0]==='/')
+ $url=$this->getRequest()->getBaseUrl().$url;
header('Location:'.$url);
exit();
}