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
This commit is contained in:
parent
18f973cdda
commit
e53ff931ab
2 changed files with 3 additions and 3 deletions
|
|
@ -2268,7 +2268,7 @@ class OutputPage extends ContextSource {
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
$response->header( 'Content-type: ' . $config->get( 'MimeType' ) . '; charset=UTF-8' );
|
$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
|
// Avoid Internet Explorer "compatibility view" in IE 8-10, so that
|
||||||
// jQuery etc. can work correctly.
|
// jQuery etc. can work correctly.
|
||||||
|
|
|
||||||
4
includes/cache/HTMLFileCache.php
vendored
4
includes/cache/HTMLFileCache.php
vendored
|
|
@ -154,7 +154,7 @@ class HTMLFileCache extends FileCacheBase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function loadFromFileCache( IContextSource $context, $mode = self::MODE_NORMAL ) {
|
public function loadFromFileCache( IContextSource $context, $mode = self::MODE_NORMAL ) {
|
||||||
global $wgMimeType, $wgLanguageCode;
|
global $wgMimeType, $wgContLang;
|
||||||
|
|
||||||
wfDebug( __METHOD__ . "()\n" );
|
wfDebug( __METHOD__ . "()\n" );
|
||||||
$filename = $this->cachePath();
|
$filename = $this->cachePath();
|
||||||
|
|
@ -166,7 +166,7 @@ class HTMLFileCache extends FileCacheBase {
|
||||||
|
|
||||||
$context->getOutput()->sendCacheControl();
|
$context->getOutput()->sendCacheControl();
|
||||||
header( "Content-Type: $wgMimeType; charset=UTF-8" );
|
header( "Content-Type: $wgMimeType; charset=UTF-8" );
|
||||||
header( "Content-Language: $wgLanguageCode" );
|
header( 'Content-Language: ' . $wgContLang->getHtmlCode() );
|
||||||
if ( $this->useGzip() ) {
|
if ( $this->useGzip() ) {
|
||||||
if ( wfClientAcceptsGzip() ) {
|
if ( wfClientAcceptsGzip() ) {
|
||||||
header( 'Content-Encoding: gzip' );
|
header( 'Content-Encoding: gzip' );
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue