Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2093,6 +2093,7 @@ |
2094 | 2094 | |
2095 | 2095 | $dir = $wgContLang->getDir(); |
2096 | 2096 | |
| 2097 | + $htmlAttribs = array( 'lang' => $wgContLanguageCode, 'dir' => $dir ); |
2097 | 2098 | if ( $wgHtml5 ) { |
2098 | 2099 | if ( $wgWellFormedXml ) { |
2099 | 2100 | # Unknown elements and attributes are okay in XML, but unknown |
— | — | @@ -2107,19 +2108,17 @@ |
2108 | 2109 | # Much saner. |
2109 | 2110 | $ret .= "<!doctype html>\n"; |
2110 | 2111 | } |
2111 | | - $ret .= "<html lang=\"$wgContLanguageCode\" dir=\"$dir\""; |
2112 | 2112 | if ( $wgHtml5Version ) { |
2113 | | - $ret .= " version=\"$wgHtml5Version\""; |
| 2113 | + $htmlAttribs['version'] = $wgHtml5Version; |
2114 | 2114 | } |
2115 | | - $ret .= ">\n"; |
2116 | 2115 | } else { |
2117 | 2116 | $ret .= "<!DOCTYPE html PUBLIC \"$wgDocType\" \"$wgDTD\">\n"; |
2118 | | - $ret .= "<html xmlns=\"{$wgXhtmlDefaultNamespace}\" "; |
| 2117 | + $htmlAttribs['xmlns'] = $wgXhtmlDefaultNamespace; |
2119 | 2118 | foreach ( $wgXhtmlNamespaces as $tag => $ns ) { |
2120 | | - $ret .= "xmlns:{$tag}=\"{$ns}\" "; |
| 2119 | + $htmlAttribs["xmlns:$tag"] = $ns; |
2121 | 2120 | } |
2122 | | - $ret .= "lang=\"$wgContLanguageCode\" dir=\"$dir\">\n"; |
2123 | 2121 | } |
| 2122 | + $ret .= Html::element( 'html', $htmlAttribs ) . "\n"; |
2124 | 2123 | |
2125 | 2124 | $openHead = Html::openElement( 'head' ); |
2126 | 2125 | if ( $openHead ) { |