From 60e486b5697030d18311f67de29b95a892c7d95d Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 7 Feb 2006 19:05:33 +0000 Subject: Added UrlFormat property to THttpRequest. --- framework/Web/THttpResponse.php | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'framework/Web/THttpResponse.php') diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php index ea41ab16..d51c0cf2 100644 --- a/framework/Web/THttpResponse.php +++ b/framework/Web/THttpResponse.php @@ -274,24 +274,25 @@ class THttpResponse extends TModule implements ITextWriter */ public function flush() { - $header = $this->getContentTypeHeader(); - $this->appendHeader($header); + Prado::trace("Flushing output",'System.Web.THttpResponse'); + $this->sendContentTypeHeader(); if($this->_bufferOutput) ob_flush(); - Prado::trace("Flushing output $header",'System.Web.THttpResponse'); } /** - * @return string content type and charset header + * Sends content type header if charset is not empty. */ - protected function getContentTypeHeader() + protected function sendContentTypeHeader() { - $app = $this->getApplication()->getGlobalization(); $charset = $this->getCharset(); - if(empty($charset)) - $charset = !is_null($app) ? $app->getCharset() : 'UTF-8'; - $type = $this->getContentType(); - return "Content-Type: $type; charset=$charset"; + if(empty($charset) && ($globalization=$this->getApplication()->getGlobalization())!==null) + $charset = $globalization->getCharset(); + if(!empty($charset)) + { + $header='Content-Type: '.$this->getContentType().';charset='.$charset; + $this->appendHeader($header); + } } /** @@ -310,14 +311,10 @@ class THttpResponse extends TModule implements ITextWriter */ public function appendHeader($value) { + Prado::trace("Sending header '$value'",'System.Web.THttpResponse'); header($value); } - public function sendContentTypeHeader($type=null) - { - - } - /** * Writes a log message into error log. * This method is simple wrapper of PHP function error_log. -- cgit v1.2.3