jenkins-bot has submitted this change and it was merged. Change subject: Apply wfBCP47() to HTTP response header Content-Language ......................................................................
Apply wfBCP47() to HTTP response header Content-Language See https://tools.ietf.org/html/rfc7231#section-3.1.3 for Content-Language. This references https://tools.ietf.org/html/rfc5646 aka BCP 47. Example: curl -I https://crh.wikipedia.org/wiki/Ba%C5%9F_Saife | grep -i '^content-language:' should contain Content-language: crh-Latn instead of Content-language: crh-latn Change-Id: Ice4f40911c3761c2542430935bc1898bc4e7a4d4 --- M includes/OutputPage.php M includes/cache/HTMLFileCache.php 2 files changed, 3 insertions(+), 3 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 4c4fb1c..ba14b99 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2268,7 +2268,7 @@ ob_start(); $response->header( 'Content-type: ' . $config->get( 'MimeType' ) . '; charset=UTF-8' ); - $response->header( 'Content-language: ' . $config->get( 'LanguageCode' ) ); + $response->header( 'Content-language: ' . $config->get( 'ContLang' )->getHtmlCode() ); // Avoid Internet Explorer "compatibility view" in IE 8-10, so that // jQuery etc. can work correctly. diff --git a/includes/cache/HTMLFileCache.php b/includes/cache/HTMLFileCache.php index 52ae279..71011e0 100644 --- a/includes/cache/HTMLFileCache.php +++ b/includes/cache/HTMLFileCache.php @@ -154,7 +154,7 @@ * @return void */ public function loadFromFileCache( IContextSource $context, $mode = self::MODE_NORMAL ) { - global $wgMimeType, $wgLanguageCode; + global $wgMimeType, $wgContLang; wfDebug( __METHOD__ . "()\n" ); $filename = $this->cachePath(); @@ -166,7 +166,7 @@ $context->getOutput()->sendCacheControl(); header( "Content-Type: $wgMimeType; charset=UTF-8" ); - header( "Content-Language: $wgLanguageCode" ); + header( 'Content-Language: ' . $wgContLang->getHtmlCode() ); if ( $this->useGzip() ) { if ( wfClientAcceptsGzip() ) { header( 'Content-Encoding: gzip' ); -- To view, visit https://gerrit.wikimedia.org/r/251734 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ice4f40911c3761c2542430935bc1898bc4e7a4d4 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Gerrit Patch Uploader <gerritpatchuploa...@gmail.com> Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org> Gerrit-Reviewer: Daniel Friesen <dan...@nadir-seen-fire.com> Gerrit-Reviewer: Fomafix <foma...@googlemail.com> Gerrit-Reviewer: Gerrit Patch Uploader <gerritpatchuploa...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits