X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Flogging%2FBlockLogFormatter.php;h=d49e3c5710d80a63af09bb474e95bc6186a849eb;hb=a1ef77b2d80830fbcb617a83961d78cff9d6e384;hp=ead290f0624f6d61431b1c5f4dd534396e31e5c3;hpb=a7c7cfb33404f5bc314a17b95544d90017d8917d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/logging/BlockLogFormatter.php b/includes/logging/BlockLogFormatter.php index ead290f062..d49e3c5710 100644 --- a/includes/logging/BlockLogFormatter.php +++ b/includes/logging/BlockLogFormatter.php @@ -22,6 +22,8 @@ * @since 1.25 */ +use MediaWiki\MediaWikiServices; + /** * This class formats block log entries. * @@ -138,7 +140,9 @@ class BlockLogFormatter extends LogFormatter { $linkRenderer = $this->getLinkRenderer(); if ( $this->entry->isDeleted( LogPage::DELETED_ACTION ) // Action is hidden || !( $subtype === 'block' || $subtype === 'reblock' ) - || !$this->context->getUser()->isAllowed( 'block' ) + || !MediaWikiServices::getInstance() + ->getPermissionManager() + ->userHasRight( $this->context->getUser(), 'block' ) ) { return ''; } @@ -262,6 +266,10 @@ class BlockLogFormatter extends LogFormatter { return $params; } + /** + * @inheritDoc + * @suppress PhanTypeInvalidDimOffset + */ public function formatParametersForApi() { $ret = parent::formatParametersForApi(); if ( isset( $ret['flags'] ) ) {