X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=blobdiff_plain;f=includes%2Flogging%2FBlockLogFormatter.php;h=a0bfb59345d8cf7f96334775bfa46aacab204b60;hb=01936fa994fa79946d090b5caddbb737c77677c9;hp=aa90d1d369668f519f2a2dd4ec7d301af6e9ee0f;hpb=40a628a501fc05bb00e834fe359ca4061925f320;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/logging/BlockLogFormatter.php b/includes/logging/BlockLogFormatter.php index aa90d1d369..a0bfb59345 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. * @@ -57,8 +59,15 @@ class BlockLogFormatter extends LogFormatter { // The lrm is needed to make sure that the number // is shown on the correct side of the tooltip text. $durationTooltip = '‎' . htmlspecialchars( $params[4] ); - $params[4] = Message::rawParam( "" . - $this->context->getLanguage()->translateBlockExpiry( $params[4] ) . '' ); + $params[4] = Message::rawParam( + "" . + $this->context->getLanguage()->translateBlockExpiry( + $params[4], + $this->context->getUser(), + wfTimestamp( TS_UNIX, $this->entry->getTimestamp() ) + ) . + '' + ); $params[5] = isset( $params[5] ) ? self::formatBlockFlags( $params[5], $this->context->getLanguage() ) : ''; } @@ -90,6 +99,7 @@ class BlockLogFormatter extends LogFormatter { public function getActionLinks() { $subtype = $this->entry->getSubtype(); + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); if ( $this->entry->isDeleted( LogPage::DELETED_ACTION ) // Action is hidden || !( $subtype === 'block' || $subtype === 'reblock' ) || !$this->context->getUser()->isAllowed( 'block' ) @@ -100,13 +110,13 @@ class BlockLogFormatter extends LogFormatter { // Show unblock/change block link $title = $this->entry->getTarget(); $links = [ - Linker::linkKnown( + $linkRenderer->makeKnownLink( SpecialPage::getTitleFor( 'Unblock', $title->getDBkey() ), - $this->msg( 'unblocklink' )->escaped() + $this->msg( 'unblocklink' )->text() ), - Linker::linkKnown( + $linkRenderer->makeKnownLink( SpecialPage::getTitleFor( 'Block', $title->getDBkey() ), - $this->msg( 'change-blocklink' )->escaped() + $this->msg( 'change-blocklink' )->text() ) ];