Well, well, well… The LambCutlet Disorganisation is back in business with some good old content negotiation and correctly serving XHTML as application/xhtml+xml, it’s correct MIME-type to XHTML browsers; having for the last 4 months or so, always served the XHTML as text/html regardless what the user agent was capable of accepting.
The changes I’ve implimented are just a quick port of what I used to have running when this blog was still hand rolled and they are as follows:
In ./wp-blog-header.php, find…
if ( !isset($doing_rss) || !$doing_rss ) {
@header ('X-Pingback: '. get_settings('siteurl') . '/xmlrpc.php');
} else {
Replace with…
if((strstr($_SERVER["HTTP_ACCEPT"], 'application/xhtml+xml'))||(strstr($_SERVER["HTTP_USER_AGENT"], 'W3C_Validator'))||(strstr($_SERVER["HTTP_USER_AGENT"], 'WDG_Validator'))) {
$http_accept_mime = 'application/xhtml+xml';
} else {
$http_accept_mime = 'text/html';
}
if ( !isset($doing_rss) || !$doing_rss ) {
@header ('X-Pingback: '. get_settings('siteurl') . '/xmlrpc.php');
@header ('Content-Type: ' . $http_accept_mime);
} else {
In ./index.php, find…
<meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo('charset'); ?>" />
Replace with…
<meta http-equiv="Content-Type" content="<?php echo $http_accept_mime; ?>; charset=< ?php bloginfo('charset'); ?>" />
Update the files and anally retentive XHTML loving will be all yours again. :D