From: Thalia Date: Wed, 9 Jan 2019 15:58:16 +0000 (+0000) Subject: Improve readability of LogFormatter::makePageLink X-Git-Tag: 1.34.0-rc.0~3109^2 X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=commitdiff_plain;h=c32b871ef659db2e7c11f702072b01e5dbc11f82;p=lhc%2Fweb%2Fwiklou.git Improve readability of LogFormatter::makePageLink Change-Id: I912d9626b99697d5a0394b72a56ffc8a5e7aa1bb --- 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;