X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Flogging%2FLogFormatter.php;h=0ffe691d6555dae8c032376d043748162a901f1d;hb=1796d99f7083c9ac7a5a0f18b14d4e3568af37c9;hp=0f1e1f7f1e8f7cf5cf98b4b70ebe1f2eba79a73f;hpb=949dc920ee61e838320186565cb6dc146a013b25;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/logging/LogFormatter.php b/includes/logging/LogFormatter.php index 0f1e1f7f1e..0ffe691d65 100644 --- a/includes/logging/LogFormatter.php +++ b/includes/logging/LogFormatter.php @@ -108,6 +108,12 @@ class LogFormatter { */ private $linkRenderer; + /** + * @see LogFormatter::getMessageParameters + * @var array + */ + protected $parsedParameters; + protected function __construct( LogEntry $entry ) { $this->entry = $entry; $this->context = RequestContext::getMain(); @@ -193,7 +199,7 @@ class LogFormatter { } /** - * 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 @@ -214,7 +220,7 @@ class LogFormatter { } /** - * 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 @@ -261,19 +267,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 +646,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() . ']]'; }