X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flogging%2FProtectLogFormatter.php;h=81d9aa2e45457efd8f8ed6644a1a2d1f6e441972;hb=98f9cfd93f77150c5a8dac5e266386d977c748b9;hp=02a69720038b10065aec61cdc615823ccf113175;hpb=8d91ac5f12f6883b34f64991fd277954fe8ed37e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/logging/ProtectLogFormatter.php b/includes/logging/ProtectLogFormatter.php index 02a6972003..81d9aa2e45 100644 --- a/includes/logging/ProtectLogFormatter.php +++ b/includes/logging/ProtectLogFormatter.php @@ -101,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(), @@ -150,9 +153,10 @@ class ProtectLogFormatter extends LogFormatter { public function formatParametersForApi() { $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'] = MediaWikiServices::getInstance()->getContentLanguage()-> + $detail['expiry'] = $contLang-> formatExpiry( $detail['expiry'], TS_ISO_8601, 'infinite' ); } }