X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flogging%2FLogFormatter.php;h=b28bb7df779673450848340c07de8192fa2a5eb3;hb=d2b5c86eac27b0ce60076502f195b1b37d762c60;hp=2a47943a0383ab0436a9c18ec7aa4ae5aca2e250;hpb=f4a53c54065c385172363416eb3cb44b67585ca2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/logging/LogFormatter.php b/includes/logging/LogFormatter.php index 2a47943a03..b28bb7df77 100644 --- a/includes/logging/LogFormatter.php +++ b/includes/logging/LogFormatter.php @@ -261,19 +261,15 @@ class LogFormatter { $text = wfMessage( 'undeletedarticle' ) ->rawParams( $target )->inContentLanguage()->escaped(); break; - // @codingStandardsIgnoreStart Long line //case 'revision': // Revision deletion //case 'event': // Log deletion // see https://github.com/wikimedia/mediawiki/commit/a9c243b7b5289dad204278dbe7ed571fd914e395 //default: - // @codingStandardsIgnoreEnd } break; case 'patrol': - // @codingStandardsIgnoreStart Long line // https://github.com/wikimedia/mediawiki/commit/1a05f8faf78675dc85984f27f355b8825b43efff - // @codingStandardsIgnoreEnd // Create a diff link to the patrolled revision if ( $entry->getSubtype() === 'patrol' ) { $diffLink = htmlspecialchars( @@ -644,12 +640,13 @@ class LogFormatter { * @return string */ protected function makePageLink( Title $title = null, $parameters = [], $html = null ) { + if ( !$title instanceof Title ) { + throw new MWException( 'Expected title, got null' ); + } if ( !$this->plaintext ) { - $link = Linker::link( $title, $html, [], $parameters ); + $html = $html !== null ? new HtmlArmor( $html ) : $html; + $link = $this->getLinkRenderer()->makeLink( $title, $html, [], $parameters ); } else { - if ( !$title instanceof Title ) { - throw new MWException( "Expected title, got null" ); - } $link = '[[' . $title->getPrefixedText() . ']]'; } @@ -866,10 +863,12 @@ class LogFormatter { case 'title': case 'title-link': $title = Title::newFromText( $value ); - if ( $title ) { - $value = []; - ApiQueryBase::addTitleInfo( $value, $title, "{$name}_" ); + if ( !$title ) { + // Huh? Do something halfway sane. + $title = SpecialPage::getTitleFor( 'Badtitle', $value ); } + $value = []; + ApiQueryBase::addTitleInfo( $value, $title, "{$name}_" ); return $value; case 'user':