summaryrefslogtreecommitdiff
path: root/framework/Web/THttpResponse.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/THttpResponse.php')
-rw-r--r--framework/Web/THttpResponse.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php
index 1f0bf6f2..d76648b7 100644
--- a/framework/Web/THttpResponse.php
+++ b/framework/Web/THttpResponse.php
@@ -426,8 +426,8 @@ class THttpResponse extends TModule implements ITextWriter
*/
public function httpRedirect($url)
{
- if(!$this->getApplication()->getRequestCompleted())
- $this->getApplication()->onEndRequest();
+ $this->ensureHeadersSent();
+
if($url[0]==='/')
$url=$this->getRequest()->getBaseUrl().$url;
if ($this->_status >= 300 && $this->_status < 400)
@@ -436,6 +436,9 @@ class THttpResponse extends TModule implements ITextWriter
else
header('Location: '.str_replace('&amp;','&',$url));
+ if(!$this->getApplication()->getRequestCompleted())
+ $this->getApplication()->onEndRequest();
+
exit();
}