diff options
author | xue <> | 2006-06-19 12:37:59 +0000 |
---|---|---|
committer | xue <> | 2006-06-19 12:37:59 +0000 |
commit | cb1021da880b5200fdfe87e43d96a86de811e482 (patch) | |
tree | 9e3166bcaa641910dd1d30a99e44004c3711ffc4 /framework/Web/THttpResponse.php | |
parent | 551cbab5c5921acfa23b1abe6dbac40808cc5508 (diff) |
Fixed #244, #245.
Diffstat (limited to 'framework/Web/THttpResponse.php')
-rw-r--r-- | framework/Web/THttpResponse.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php index 5a3ff99d..f455f48d 100644 --- a/framework/Web/THttpResponse.php +++ b/framework/Web/THttpResponse.php @@ -274,12 +274,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();
}
|