$wgDTD = 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd';
$wgXhtmlDefaultNamespace = 'http://www.w3.org/1999/xhtml';
+/**
+ * Temporary setting to disable HTML 5 for the unlikely event that it causes
+ * everything to blow up. If all goes well, should be removed (and forced
+ * true) well before it ever makes it into a release. If set to false, go back
+ * to serving an XHTML 1.0 Transitional doctype (per $wgDocType et al. above).
+ */
+$wgHtml5 = true;
+
/**
* Permit other namespaces in addition to the w3.org default.
* Use the prefix for the key and the namespace for the value. For
public function headElement( Skin $sk ) {
global $wgDocType, $wgDTD, $wgContLanguageCode, $wgOutputEncoding, $wgMimeType;
global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces;
- global $wgContLang, $wgUseTrackbacks, $wgStyleVersion;
+ global $wgContLang, $wgUseTrackbacks, $wgStyleVersion, $wgHtml5;
$this->addMeta( "http:Content-Type", "$wgMimeType; charset={$wgOutputEncoding}" );
if ( $sk->commonPrintStylesheet() ) {
$ret .= "<?xml version=\"1.0\" encoding=\"$wgOutputEncoding\" ?" . ">\n";
}
- $ret .= "<!DOCTYPE html PUBLIC \"$wgDocType\" \"$wgDTD\">\n";
+ if ( $wgHtml5 ) {
+ $ret .= '<!doctype html>';
+ } else {
+ $ret .= "<!DOCTYPE html PUBLIC \"$wgDocType\" \"$wgDTD\">\n";
+ }
if ( '' == $this->getHTMLTitle() ) {
$this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() ));
}
protected function addDefaultMeta() {
- global $wgVersion;
+ global $wgVersion, $wgHtml5;
static $called = false;
if ( $called ) {
}
$called = true;
- $this->addMeta( 'http:Content-Style-Type', 'text/css' ); //bug 15835
+ if ( !$wgHtml5 ) {
+ $this->addMeta( 'http:Content-Style-Type', 'text/css' ); //bug 15835
+ }
$this->addMeta( 'generator', "MediaWiki $wgVersion" );
$p = "{$this->mIndexPolicy},{$this->mFollowPolicy}";