Changeset 6762
- Timestamp:
- 12/27/07 16:44:55 (2 years ago)
- Files:
-
- branches/1.1/lib/response/sfWebResponse.class.php (modified) (1 diff)
- branches/1.1/test/unit/response/sfWebResponseTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/response/sfWebResponse.class.php
r6662 r6762 247 247 { 248 248 // add charset if needed 249 if (false === stripos($value, 'charset') )249 if (false === stripos($value, 'charset') && 0 === stripos($value, 'text/')) 250 250 { 251 251 $value .= '; charset='.$this->getParameter('charset'); branches/1.1/test/unit/response/sfWebResponseTest.php
r6665 r6762 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(6 4, new lime_output_color());13 $t = new lime_test(65, new lime_output_color()); 14 14 15 15 class myWebResponse extends sfWebResponse … … 111 111 $t->is($response->getContentType(), 'text/xml;charset = ISO-8859-1', '->setContentType() does nothing if a charset is given'); 112 112 113 $response->setContentType('image/jpg'); 114 $t->is($response->getContentType(), 'image/jpg', '->setContentType() does not add a charset if the content-type is not text/*'); 115 113 116 $t->is($response->getContentType(), $response->getHttpHeader('content-type'), '->getContentType() is an alias for ->getHttpHeader(\'content-type\')'); 114 117

