From 31ba7a3e5c6f86dc4a71c3cc921faa813754f144 Mon Sep 17 00:00:00 2001 From: Thalia Date: Wed, 9 Jan 2019 16:09:37 +0000 Subject: [PATCH] Fix malformed output of block logs Avoid adding to expiry parameter whenever block log is stored as plaintext. Bug: T208523 Change-Id: Id3fcdfda7311484911ae1f57ec262a2c6e6ab00b --- includes/logging/BlockLogFormatter.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/includes/logging/BlockLogFormatter.php b/includes/logging/BlockLogFormatter.php index 2698cbee2d..6bc3f3969a 100644 --- a/includes/logging/BlockLogFormatter.php +++ b/includes/logging/BlockLogFormatter.php @@ -57,15 +57,20 @@ 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], - $this->context->getUser(), - wfTimestamp( TS_UNIX, $this->entry->getTimestamp() ) - ) . - '' + $blockExpiry = $this->context->getLanguage()->translateBlockExpiry( + $params[4], + $this->context->getUser(), + wfTimestamp( TS_UNIX, $this->entry->getTimestamp() ) ); + if ( $this->plaintext ) { + $params[4] = Message::rawParam( $blockExpiry ); + } else { + $params[4] = Message::rawParam( + "" . + $blockExpiry . + '' + ); + } $params[5] = isset( $params[5] ) ? self::formatBlockFlags( $params[5], $this->context->getLanguage() ) : ''; -- 2.20.1