Development

Changeset 6761

You must first sign up to be able to contribute.

Changeset 6761

Show
Ignore:
Timestamp:
12/27/07 16:44:47 (10 months ago)
Author:
fabien
Message:

fixed content type charset on non text/* content-type (closes #1811, #1968)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/lib/response/sfWebResponse.class.php

    r6744 r6761  
    236236  { 
    237237    // add charset if needed 
    238     if (false === stripos($value, 'charset')
     238    if (false === stripos($value, 'charset') && 0 === stripos($value, 'text/')
    239239    { 
    240240      $value .= '; charset='.sfConfig::get('sf_charset'); 
  • branches/1.0/test/unit/response/sfWebResponseTest.php

    r2884 r6761  
    1212require_once($_test_dir.'/unit/sfContextMock.class.php'); 
    1313 
    14 $t = new lime_test(63, new lime_output_color()); 
     14$t = new lime_test(64, new lime_output_color()); 
    1515 
    1616class myWebResponse extends sfWebResponse 
     
    112112$t->is($response->getContentType(), 'text/xml;charset = ISO-8859-1', '->setContentType() does nothing if a charset is given'); 
    113113 
     114$response->setContentType('image/jpg'); 
     115$t->is($response->getContentType(), 'image/jpg', '->setContentType() does not add a charset if the content-type is not text/*'); 
     116 
    114117$t->is($response->getContentType(), $response->getHttpHeader('content-type'), '->getContentType() is an alias for ->getHttpHeader(\'content-type\')'); 
    115118