Use getHtmlCode() instead of getCode() to set the lang attribute
authorFomafix <fomafix@googlemail.com>
Wed, 17 Dec 2014 08:10:26 +0000 (08:10 +0000)
committer[[mw:User:Fomafix]] <gerritpatchuploader@gmail.com>
Wed, 17 Dec 2014 08:10:26 +0000 (08:10 +0000)
The lang attribute of HTML elements should conform to BCP 47.

Change-Id: Ia8a088add29daea39e90bb277279a6485990d18a

includes/page/Article.php

index 0318f65..45b6298 100644 (file)
@@ -835,7 +835,7 @@ class Article implements Page {
 
                if ( $showCacheHint ) {
                        $dir = $this->getContext()->getLanguage()->getDir();
-                       $lang = $this->getContext()->getLanguage()->getCode();
+                       $lang = $this->getContext()->getLanguage()->getHtmlCode();
 
                        $outputPage->wrapWikiMsg(
                                "<div id='mw-clearyourcache' lang='$lang' dir='$dir' class='mw-content-$dir'>\n$1\n</div>",