From 423f550009173e4df0e70e016831d293c8f5d1df Mon Sep 17 00:00:00 2001 From: Liangent Date: Sat, 23 Mar 2013 08:07:33 +0000 Subject: [PATCH] Fix various language tags used in Html attribs to use wfBCP47() Change-Id: I823ffacf5a55e53d6ab5383c1a42a9199d56f11d --- includes/OutputPage.php | 2 +- includes/SkinTemplate.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 3657ac30bc..96a503e81c 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -3215,7 +3215,7 @@ $templates foreach ( $variants as $_v ) { $tags["variant-$_v"] = Html::element( 'link', array( 'rel' => 'alternate', - 'hreflang' => $_v, + 'hreflang' => wfBCP47( $_v ), 'href' => $this->getTitle()->getLocalURL( array( 'variant' => $_v ) ) ) ); } diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 18f410a35c..3c58f48cf8 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -156,8 +156,8 @@ class SkinTemplate extends Skin { 'text' => $ilLangName, 'title' => $languageLinkTitle->getText(), 'class' => $class, - 'lang' => $ilInterwikiCode, - 'hreflang' => $ilInterwikiCode + 'lang' => wfBCP47( $ilInterwikiCode ), + 'hreflang' => wfBCP47( $ilInterwikiCode ), ); } } @@ -1043,8 +1043,8 @@ class SkinTemplate extends Skin { 'class' => ( $code == $preferred ) ? 'selected' : false, 'text' => $varname, 'href' => $title->getLocalURL( array( 'variant' => $code ) + $params ), - 'lang' => $code, - 'hreflang' => $code + 'lang' => wfBCP47( $code ), + 'hreflang' => wfBCP47( $code ), ); } } -- 2.20.1