r63992 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63991‎ | r63992 | r63993 >
Date:05:12, 21 March 2010
Author:simetrical
Status:resolved (Comments)
Tags:
Comment:
Clean up <html> generation slightly
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -2093,6 +2093,7 @@
20942094
20952095 $dir = $wgContLang->getDir();
20962096
 2097+ $htmlAttribs = array( 'lang' => $wgContLanguageCode, 'dir' => $dir );
20972098 if ( $wgHtml5 ) {
20982099 if ( $wgWellFormedXml ) {
20992100 # Unknown elements and attributes are okay in XML, but unknown
@@ -2107,19 +2108,17 @@
21082109 # Much saner.
21092110 $ret .= "<!doctype html>\n";
21102111 }
2111 - $ret .= "<html lang=\"$wgContLanguageCode\" dir=\"$dir\"";
21122112 if ( $wgHtml5Version ) {
2113 - $ret .= " version=\"$wgHtml5Version\"";
 2113+ $htmlAttribs['version'] = $wgHtml5Version;
21142114 }
2115 - $ret .= ">\n";
21162115 } else {
21172116 $ret .= "<!DOCTYPE html PUBLIC \"$wgDocType\" \"$wgDTD\">\n";
2118 - $ret .= "<html xmlns=\"{$wgXhtmlDefaultNamespace}\" ";
 2117+ $htmlAttribs['xmlns'] = $wgXhtmlDefaultNamespace;
21192118 foreach ( $wgXhtmlNamespaces as $tag => $ns ) {
2120 - $ret .= "xmlns:{$tag}=\"{$ns}\" ";
 2119+ $htmlAttribs["xmlns:$tag"] = $ns;
21212120 }
2122 - $ret .= "lang=\"$wgContLanguageCode\" dir=\"$dir\">\n";
21232121 }
 2122+ $ret .= Html::element( 'html', $htmlAttribs ) . "\n";
21242123
21252124 $openHead = Html::openElement( 'head' );
21262125 if ( $openHead ) {

Comments

#Comment by Tim Starling (talk | contribs)   09:40, 31 August 2010

Was fixed in r64166.

Status & tagging log