X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flogging%2FProtectLogFormatter.php;h=6e3b26b17f85e8785c702c7542e53039816d2ae0;hb=0705929343a7fbd3417a475cd0c9a0dfe53c3dc4;hp=931829ab2017ab81b0d688971ced6b97a3e8c7e0;hpb=5123888304ecb6f7f768fba569ec86ad79b344f1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/logging/ProtectLogFormatter.php b/includes/logging/ProtectLogFormatter.php index 931829ab20..6e3b26b17f 100644 --- a/includes/logging/ProtectLogFormatter.php +++ b/includes/logging/ProtectLogFormatter.php @@ -22,6 +22,8 @@ * @since 1.26 */ +use MediaWiki\MediaWikiServices; + /** * This class formats protect log entries. * @@ -99,7 +101,10 @@ class ProtectLogFormatter extends LogFormatter { ]; // Show change protection link - if ( $this->context->getUser()->isAllowed( 'protect' ) ) { + if ( !MediaWikiServices::getInstance() + ->getPermissionManager() + ->userHasRight( $this->context->getUser(), 'protect' ) + ) { $links[] = $linkRenderer->makeKnownLink( $title, $this->msg( 'protect_change' )->text(), @@ -146,13 +151,13 @@ class ProtectLogFormatter extends LogFormatter { } public function formatParametersForApi() { - global $wgContLang; - $ret = parent::formatParametersForApi(); if ( isset( $ret['details'] ) && is_array( $ret['details'] ) ) { + $contLang = MediaWikiServices::getInstance()->getContentLanguage(); foreach ( $ret['details'] as &$detail ) { if ( isset( $detail['expiry'] ) ) { - $detail['expiry'] = $wgContLang->formatExpiry( $detail['expiry'], TS_ISO_8601, 'infinite' ); + $detail['expiry'] = $contLang-> + formatExpiry( $detail['expiry'], TS_ISO_8601, 'infinite' ); } } }