diff options
author | emkael <emkael@tlen.pl> | 2017-03-15 17:01:02 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2017-03-15 17:01:02 +0100 |
commit | 96481892cf693fa33d5f14a3ec6beaed26bd4485 (patch) | |
tree | 97601b9bc240d7994d09719a5819bf035af396e1 /lib/prado/framework/Web/THttpResponse.php | |
parent | c852b322361bb15771e19349c9e36a6f5a4616f2 (diff) |
* bumping Prado version to 3.3.2-r5dd4b52
Diffstat (limited to 'lib/prado/framework/Web/THttpResponse.php')
-rw-r--r-- | lib/prado/framework/Web/THttpResponse.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/prado/framework/Web/THttpResponse.php b/lib/prado/framework/Web/THttpResponse.php index 93d3c91..48328c3 100644 --- a/lib/prado/framework/Web/THttpResponse.php +++ b/lib/prado/framework/Web/THttpResponse.php @@ -426,13 +426,28 @@ class THttpResponse extends TModule implements ITextWriter { $this->ensureHeadersSent(); + // Under IIS, explicitly send an HTTP response including the status code + // this is handled automatically by PHP on Apache and others + $isIIS = (stripos($this->getRequest()->getServerSoftware(), "microsoft-iis") !== false); if($url[0]==='/') $url=$this->getRequest()->getBaseUrl().$url; if ($this->_status >= 300 && $this->_status < 400) + { // The status code has been modified to a valid redirection status, send it + if($isIIS) + { + header('HTTP/1.1 ' . $this->_status . ' ' . self::$HTTP_STATUS_CODES[ + array_key_exists($this->_status, self::$HTTP_STATUS_CODES) + ? $this->_status + : 302 + ]); + } header('Location: '.str_replace('&','&',$url), true, $this->_status); - else + } else { + if($isIIS) + header('HTTP/1.1 302 '.self::$HTTP_STATUS_CODES[302]); header('Location: '.str_replace('&','&',$url)); + } if(!$this->getApplication()->getRequestCompleted()) $this->getApplication()->onEndRequest(); @@ -719,4 +734,3 @@ class THttpResponse extends TModule implements ITextWriter return Prado::createComponent($type, $writer); } } - |