From: jenkins-bot Date: Wed, 9 Jan 2019 23:36:27 +0000 (+0000) Subject: Merge "Improve readability of LogFormatter::makePageLink" X-Git-Tag: 1.34.0-rc.0~3109 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=6196eaf08ce62962b9466435f33dddab65e6775b;hp=4ad6525624fc08cb7531db0a1abee8a99d0e3420 Merge "Improve readability of LogFormatter::makePageLink" --- 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;