Merge "Chinese Conversion Table Update 2018-4"
[lhc/web/wiklou.git] / includes / logging / LogFormatter.php
index e14c485..b07f20e 100644 (file)
@@ -51,13 +51,7 @@ class LogFormatter {
                global $wgLogActionsHandlers;
                $fulltype = $entry->getFullType();
                $wildcard = $entry->getType() . '/*';
-               $handler = '';
-
-               if ( isset( $wgLogActionsHandlers[$fulltype] ) ) {
-                       $handler = $wgLogActionsHandlers[$fulltype];
-               } elseif ( isset( $wgLogActionsHandlers[$wildcard] ) ) {
-                       $handler = $wgLogActionsHandlers[$wildcard];
-               }
+               $handler = $wgLogActionsHandlers[$fulltype] ?? $wgLogActionsHandlers[$wildcard] ?? '';
 
                if ( $handler !== '' && is_string( $handler ) && class_exists( $handler ) ) {
                        return new $handler( $entry );
@@ -650,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;