View Issue Details

IDProjectCategoryView StatusLast Update
0012641mantisbthtmlpublic2014-12-08 02:08
Reportereiben Assigned Todhx  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.3.0dev 
Target Version1.3.0-beta.1 
Summary0012641: content-type not valid for IE
Description

The HTTP content-type "application/xhtml+xml" causes IE to try to download the page instead of displaying it. Firefox seems to have no problem with that.

Tested on Windows 7 x64 with IE 8.0

Additional Information

I modified the http_content_headers() function in http_api.php to:

/**

  • Set content-type headers.
    */
    function http_content_headers() {
    if ( !headers_sent() ) {
    if (stristr($_SERVER[HTTP_ACCEPT], "application/xhtml+xml")) {
    header( 'Content-Type: application/xhtml+xml; charset=UTF-8' );
    } else {
    header( 'Content-Type: text/html; charset=UTF-8' );
    }
    // Disallow Internet Explorer from attempting to second guess the Content-Type
    // header as per http://blogs.msdn.com/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-pro
    header( 'X-Content-Type-Options: nosniff' );
    }
    }
Tagspatch

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 
related to 0012679 closedgiallu http_content_headers() xhtml headers cause issues on install.php (version 1.3) 
child of 0012545 closeddhx Output XHTML strict so browsers can validate the output of MantisBT 

Activities

dhx

dhx

2010-12-31 01:47

reporter   ~0027762

Thanks for the great patch - this is exactly what we were looking for!

I'll have this committed shortly.

dhx

dhx

2011-01-07 03:37

reporter   ~0027836

Thanks, committed!

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036473

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master f081ed1f

2011-01-07 03:34

eiben

Committer: dhx


Details Diff
Fix 0012641: Internet Explorer does not support xhtml+xml MIME type

Internet Explorer prior to version 9 does not support the
application/xhtml+xml MIME type and will therefore not render pages
served up in this way.

We should check the "Accept" header sent by the browser to ensure that
the browser can handle application/xhtml+xml before we use this MIME
type. Otherwise the default should be to use the text/html MIME type for
older browsers.

Signed-off-by: David Hicks <hickseydr@optusnet.com.au>
Affected Issues
0012641
mod - core/http_api.php Diff File

MantisBT: master 8d464c02

2011-01-07 04:49

dhx


Details Diff
Fix 0012641: HTTP_ACCEPT is not a constant

Commit f081ed1f0171435e5a61880d46ca2e95a8c6b01e accidentally referenced
$_SERVER[HTTP_ACCEPT] where HTTP_ACCEPT is not a valid constant. It
should be $_SERVER['HTTP_ACCEPT'] instead (ie. the array key is a
string).
Affected Issues
0012641
mod - core/http_api.php Diff File