X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Flogging%2FBlockLogFormatter.php;h=21e40ec5fa05e32fa1f83369c3dd84f2bd0d402c;hb=ba67060734ecfa835f54c83540c0c136db1690d7;hp=72fcc3a5df8da050435a7f9684d3328b93679db0;hpb=9dfb45cc7c6ab53b55a484233795e7451cbee680;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/logging/BlockLogFormatter.php b/includes/logging/BlockLogFormatter.php index 72fcc3a5df..21e40ec5fa 100644 --- a/includes/logging/BlockLogFormatter.php +++ b/includes/logging/BlockLogFormatter.php @@ -58,7 +58,8 @@ class BlockLogFormatter extends LogFormatter { // is shown on the correct side of the tooltip text. $durationTooltip = '‎' . htmlspecialchars( $params[4] ); $params[4] = Message::rawParam( "" . - $this->context->getLanguage()->translateBlockExpiry( $params[4] ) . '' ); + $this->context->getLanguage()->translateBlockExpiry( $params[4], + $this->context->getUser() ) . '' ); $params[5] = isset( $params[5] ) ? self::formatBlockFlags( $params[5], $this->context->getLanguage() ) : ''; } @@ -83,9 +84,9 @@ class BlockLogFormatter extends LogFormatter { $title = $this->entry->getTarget(); // Preload user page for non-autoblocks if ( substr( $title->getText(), 0, 1 ) !== '#' ) { - return array( $title->getTalkPage() ); + return [ $title->getTalkPage() ]; } - return array(); + return []; } public function getActionLinks() { @@ -99,7 +100,7 @@ class BlockLogFormatter extends LogFormatter { // Show unblock/change block link $title = $this->entry->getTarget(); - $links = array( + $links = [ Linker::linkKnown( SpecialPage::getTitleFor( 'Unblock', $title->getDBkey() ), $this->msg( 'unblocklink' )->escaped() @@ -108,7 +109,7 @@ class BlockLogFormatter extends LogFormatter { SpecialPage::getTitleFor( 'Block', $title->getDBkey() ), $this->msg( 'change-blocklink' )->escaped() ) - ); + ]; return $this->msg( 'parentheses' )->rawParams( $this->context->getLanguage()->pipeList( $links ) )->escaped(); @@ -146,7 +147,7 @@ class BlockLogFormatter extends LogFormatter { * @return string */ public static function formatBlockFlag( $flag, $lang ) { - static $messages = array(); + static $messages = []; if ( !isset( $messages[$flag] ) ) { $messages[$flag] = htmlspecialchars( $flag ); // Fallback @@ -173,13 +174,13 @@ class BlockLogFormatter extends LogFormatter { $entry = $this->entry; $params = $entry->getParameters(); - static $map = array( + static $map = [ // While this looks wrong to be starting at 5 rather than 4, it's // because getMessageParameters uses $4 for its own purposes. '5::duration', '6:array:flags', '6::flags' => '6:array:flags', - ); + ]; foreach ( $map as $index => $key ) { if ( isset( $params[$index] ) ) { $params[$key] = $params[$index]; @@ -190,14 +191,14 @@ class BlockLogFormatter extends LogFormatter { $subtype = $entry->getSubtype(); if ( $subtype === 'block' || $subtype === 'reblock' ) { // Defaults for old log entries missing some fields - $params += array( + $params += [ '5::duration' => 'infinite', - '6:array:flags' => array(), - ); + '6:array:flags' => [], + ]; if ( !is_array( $params['6:array:flags'] ) ) { $params['6:array:flags'] = $params['6:array:flags'] === '' - ? array() + ? [] : explode( ',', $params['6:array:flags'] ); }