*/
private $linkRenderer;
+ /**
+ * @see LogFormatter::getMessageParameters
+ * @var array
+ */
+ protected $parsedParameters;
+
protected function __construct( LogEntry $entry ) {
$this->entry = $entry;
$this->context = RequestContext::getMain();
}
/**
- * Even uglier hack to maintain backwards compatibilty with IRC bots
+ * Even uglier hack to maintain backwards compatibility with IRC bots
* (T36508).
* @see getActionText()
* @return string Text
}
/**
- * Even uglier hack to maintain backwards compatibilty with IRC bots
+ * Even uglier hack to maintain backwards compatibility with IRC bots
* (T36508).
* @see getActionText()
* @return string Text
$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(
* @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() . ']]';
}
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':