From: Thalia Date: Wed, 9 Jan 2019 16:09:37 +0000 (+0000) Subject: Fix malformed output of block logs X-Git-Tag: 1.34.0-rc.0~3113 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=31ba7a3e5c6f86dc4a71c3cc921faa813754f144;p=lhc%2Fweb%2Fwiklou.git Fix malformed output of block logs Avoid adding to expiry parameter whenever block log is stored as plaintext. Bug: T208523 Change-Id: Id3fcdfda7311484911ae1f57ec262a2c6e6ab00b --- 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() ) : '';