Skip to content

Commit

Permalink
Revert "Issue #12545: Enforce XHTML strict output for all pages served"
Browse files Browse the repository at this point in the history
This reverts commit 4fc1d8b.

Fixes #13304, #14759, #15446

Conflicts:

	core/http_api.php
  • Loading branch information
dregad committed Oct 9, 2013
1 parent 6aa5e9b commit ec574f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
7 changes: 3 additions & 4 deletions core/html_api.php
Expand Up @@ -300,9 +300,8 @@ function html_page_bottom1a( $p_file = null ) {
* @return null
*/
function html_begin() {
echo '<?xml version="1.0" encoding="utf-8"?>';
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
echo '<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" >';
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">', "\n";
echo '<html xmlns="http://www.w3.org/1999/xhtml">', "\n";
}

/**
Expand All @@ -318,7 +317,7 @@ function html_head_begin() {
* @return null
*/
function html_content_type() {
echo "\t", '<meta http-equiv="Content-type" content="application/xhtml+xml; charset=UTF-8" />', "\n";
echo "\t", '<meta http-equiv="Content-type" content="text/html; charset=utf-8" />', "\n";
}

/**
Expand Down
10 changes: 1 addition & 9 deletions core/http_api.php
Expand Up @@ -128,15 +128,7 @@ function http_caching_headers( $p_allow_caching=false ) {
*/
function http_content_headers() {
if ( !headers_sent() ) {
// Only use the application/xhtml+xml MIME type if the browser
// has indicated support for this type. Internet Explorer
// prior to version 9 only supports the text/html MIME type.
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' );
}

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-protection.aspx
header( 'X-Content-Type-Options: nosniff' );
Expand Down

0 comments on commit ec574f8

Please sign in to comment.