summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web')
-rw-r--r--framework/Web/THttpResponse.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php
index b6b675c1..99d8daa5 100644
--- a/framework/Web/THttpResponse.php
+++ b/framework/Web/THttpResponse.php
@@ -314,15 +314,14 @@ class THttpResponse extends TModule implements ITextWriter
protected function sendContentTypeHeader()
{
$charset=$this->getCharset();
- if($charset==='' && ($globalization=$this->getApplication()->getGlobalization(false))!==null)
+ if(empty($charset) && ($globalization=$this->getApplication()->getGlobalization(false))!==null)
$charset=$globalization->getCharset();
- if($charset!=='')
- {
- $contentType=$this->_contentType===null?'text/html':$this->_contentType;
- $this->appendHeader('Content-Type: '.$contentType.';charset='.$charset);
- }
- else if($this->_contentType!==null)
- $this->appendHeader('Content-Type: '.$this->_contentType.';charset=UTF-8');
+
+ $contentType=empty($this->_contentType)?'text/html':$this->_contentType;
+ $charset=empty($charset)?'UTF-8':$charset;
+
+ //default is "Content-Type: text/html;charset=UTF-8"
+ $this->appendHeader('Content-Type: '.$contentType.';charset='.$charset);
}
/**