X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FHtml.php;h=32375c1f57cb0ff648c32883f050fbf6f559876e;hb=60e396da44b090fbe8fe64cb23749f4387ca8a12;hp=3dd21c113d83e13dc6dffd4f394478973721e620;hpb=c07b08b36c73e1f09d19ba384a0fe1e5b77852ba;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Html.php b/includes/Html.php index 3dd21c113d..32375c1f57 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: @@ -565,7 +566,7 @@ class Html { if ( $nonce !== null ) { $attrs['nonce'] = $nonce; } else { - if ( ContentSecurityPolicy::isEnabled( RequestContext::getMain()->getConfig() ) ) { + if ( ContentSecurityPolicy::isNonceRequired( RequestContext::getMain()->getConfig() ) ) { wfWarn( "no nonce set on script. CSP will break it" ); } } @@ -590,7 +591,7 @@ class Html { if ( $nonce !== null ) { $attrs['nonce'] = $nonce; } else { - if ( ContentSecurityPolicy::isEnabled( RequestContext::getMain()->getConfig() ) ) { + if ( ContentSecurityPolicy::isNonceRequired( RequestContext::getMain()->getConfig() ) ) { wfWarn( "no nonce set on script. CSP will break it" ); } } @@ -824,8 +825,6 @@ class Html { * @return array */ public static function namespaceSelectorOptions( array $params = [] ) { - global $wgContLang; - $options = []; if ( !isset( $params['exclude'] ) || !is_array( $params['exclude'] ) ) { @@ -838,7 +837,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 +851,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; }