X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FOutputHandler.php;h=3860b8e2b384a69ab1526de947575f44baa2629c;hb=9ffd4f085d71116f0a643dd0cbd10f1008fa4ace;hp=5104a1ab042ef5b9d2c4dbd5132459bba721da54;hpb=f22f809192f9ec1f9a09c80cd5a0254766b6c2d7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/OutputHandler.php b/includes/OutputHandler.php index 5104a1ab04..3860b8e2b3 100644 --- a/includes/OutputHandler.php +++ b/includes/OutputHandler.php @@ -31,11 +31,19 @@ function wfOutputHandler( $s ) { global $wgDisableOutputCompression, $wgValidateAllHtml; $s = wfMangleFlashPolicy( $s ); if ( $wgValidateAllHtml ) { - $headers = apache_response_headers(); - $isHTML = true; - foreach ( $headers as $name => $value ) { - if ( strtolower( $name ) == 'content-type' && strpos( $value, 'text/html' ) === false && strpos( $value, 'application/xhtml+xml' ) === false ) { - $isHTML = false; + $headers = headers_list(); + $isHTML = false; + foreach ( $headers as $header ) { + $parts = explode( ':', $header, 2 ); + if ( count( $parts ) !== 2 ) { + continue; + } + $name = strtolower( trim( $parts[0] ) ); + $value = trim( $parts[1] ); + if ( $name == 'content-type' && ( strpos( $value, 'text/html' ) === 0 + || strpos( $value, 'application/xhtml+xml' ) === 0 ) + ) { + $isHTML = true; break; } }