summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwei <>2006-08-02 00:03:01 +0000
committerwei <>2006-08-02 00:03:01 +0000
commit8ab3ff590bd67acf666c6f3e2c71032424dd93ce (patch)
treebe415fdcfbd14f331413b60e661db86feeddfd0f
parentf36d3d2f730b7f78189533553c10e439111a274d (diff)
Fixed sending default charset.
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/THttpResponse.php15
2 files changed, 8 insertions, 8 deletions
diff --git a/HISTORY b/HISTORY
index 7e28aaad..c74a807f 100644
--- a/HISTORY
+++ b/HISTORY
@@ -10,6 +10,7 @@ BUG: Ticket#302 - TDatePicker's bug with AutoPostBack set to "true" (Wei)
BUG: Ticket#306 - Prado::localize function may fail when localized string passed as parameter (Wei)
BUG: Ticket#311 - Several bugs in TDatePicker (Wei)
BUG: Ticket#312 - TDatePicker's ReadOnly property bug (Wei)
+BUG: Default charset not sent (Wei)
CHG: Ticket#206 - TBaseValidator.OnValidate is raised only when the validator is visible (Qiang)
CHG: Raised PHP version requirement to 5.1 and above (Qiang)
ENH: Ticket#178 - Added TRadioButton.UniqueGroupName property (Qiang)
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);
}
/**