X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FHtml.php;h=aac492c921cc2a4525d5cab7ddf124eac0ca78d3;hb=8b7b5f04b7c84ffd2cda3aae06513a8e4fca6128;hp=ad0130bf8f0dfc28e0a791b4132330174c848a50;hpb=e143c40fee88922eb393a88f94e60afc439d1f49;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Html.php b/includes/Html.php index ad0130bf8f..aac492c921 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -22,6 +22,7 @@ * * @file */ +use MediaWiki\MediaWikiServices; /** * This class is a collection of static functions that serve two purposes: @@ -551,10 +552,13 @@ class Html { } /** - * Output a "" or (for XML) literal "]]>". + * It is unsupported for the contents to contain the sequence ` $className ], $html ); @@ -824,8 +829,6 @@ class Html { * @return array */ public static function namespaceSelectorOptions( array $params = [] ) { - global $wgContLang; - $options = []; if ( !isset( $params['exclude'] ) || !is_array( $params['exclude'] ) ) { @@ -838,7 +841,8 @@ class Html { $options[$params['all']] = wfMessage( 'namespacesall' )->text(); } // Add all namespaces as options (in the content language) - $options += $wgContLang->getFormattedNamespaces(); + $options += + MediaWikiServices::getInstance()->getContentLanguage()->getFormattedNamespaces(); $optionsOut = []; // Filter out namespaces below 0 and massage labels @@ -851,7 +855,8 @@ class Html { // main we don't use "" but the user message describing it (e.g. "(Main)" or "(Article)") $nsName = wfMessage( 'blanknamespace' )->text(); } elseif ( is_int( $nsId ) ) { - $nsName = $wgContLang->convertNamespace( $nsId ); + $nsName = MediaWikiServices::getInstance()->getContentLanguage()-> + convertNamespace( $nsId ); } $optionsOut[$nsId] = $nsName; }