X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FOutputPage.php;h=7a2b7dfe1a4a9b51395bd23cf3e83090c140745a;hb=e72c0ac82b1102910cd9c33096946b397eed48dd;hp=7c463b6f02aed2dd5c8f19256da0617c809cd8f3;hpb=2dd8c6efe97cfb38e13fab8f34bfd887f51b1877;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 7c463b6f02..7a2b7dfe1a 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -314,15 +314,10 @@ class OutputPage extends ContextSource { * Constructor for OutputPage. This should not be called directly. * Instead a new RequestContext should be created and it will implicitly create * a OutputPage tied to that context. - * @param IContextSource|null $context + * @param IContextSource $context */ - function __construct( IContextSource $context = null ) { - if ( $context === null ) { - # Extensions should use `new RequestContext` instead of `new OutputPage` now. - wfDeprecated( __METHOD__, '1.18' ); - } else { - $this->setContext( $context ); - } + function __construct( IContextSource $context ) { + $this->setContext( $context ); } /** @@ -2200,7 +2195,7 @@ class OutputPage extends ContextSource { // IE and some other browsers use BCP 47 standards in // their Accept-Language header, like "zh-CN" or "zh-Hant". // We should handle these too. - $variantBCP47 = wfBCP47( $variant ); + $variantBCP47 = LanguageCode::bcp47( $variant ); if ( $variantBCP47 !== $variant ) { $aloption[] = 'substr=' . $variantBCP47; } @@ -2923,15 +2918,14 @@ class OutputPage extends ContextSource { $pieces = array_merge( $pieces, array_values( $this->getHeadLinksArray() ) ); $pieces = array_merge( $pieces, array_values( $this->mHeadItems ) ); - $min = ResourceLoader::inDebugMode() ? '' : '.min'; // Use an IE conditional comment to serve the script only to old IE $pieces[] = ''; $pieces[] = Html::closeElement( 'head' ); @@ -3438,7 +3432,7 @@ class OutputPage extends ContextSource { foreach ( $variants as $variant ) { $tags["variant-$variant"] = Html::element( 'link', [ 'rel' => 'alternate', - 'hreflang' => wfBCP47( $variant ), + 'hreflang' => LanguageCode::bcp47( $variant ), 'href' => $this->getTitle()->getLocalURL( [ 'variant' => $variant ] ) ]