From c32b871ef659db2e7c11f702072b01e5dbc11f82 Mon Sep 17 00:00:00 2001 From: Thalia Date: Wed, 9 Jan 2019 15:58:16 +0000 Subject: [PATCH] Improve readability of LogFormatter::makePageLink Change-Id: I912d9626b99697d5a0394b72a56ffc8a5e7aa1bb --- includes/logging/LogFormatter.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/logging/LogFormatter.php b/includes/logging/LogFormatter.php index b3afe0bb94..b07f20e6d9 100644 --- a/includes/logging/LogFormatter.php +++ b/includes/logging/LogFormatter.php @@ -644,18 +644,18 @@ class LogFormatter { protected function makePageLink( Title $title = null, $parameters = [], $html = null ) { if ( !$title instanceof Title ) { $msg = $this->msg( 'invalidtitle' )->text(); - if ( !$this->plaintext ) { - return Html::element( 'span', [ 'class' => 'mw-invalidtitle' ], $msg ); - } else { + if ( $this->plaintext ) { return $msg; + } else { + return Html::element( 'span', [ 'class' => 'mw-invalidtitle' ], $msg ); } } - if ( !$this->plaintext ) { + if ( $this->plaintext ) { + $link = '[[' . $title->getPrefixedText() . ']]'; + } else { $html = $html !== null ? new HtmlArmor( $html ) : $html; $link = $this->getLinkRenderer()->makeLink( $title, $html, [], $parameters ); - } else { - $link = '[[' . $title->getPrefixedText() . ']]'; } return $link; -- 2.20.1