From 4d2a783a382ccb6453dd91f54705a4fa31bc6ca4 Mon Sep 17 00:00:00 2001 From: Victor Barbu Date: Fri, 2 Dec 2016 00:32:17 +0200 Subject: [PATCH] Replace some usages of Linker::link with LinkRenderer Classes: PatrolLogFormatter and ProtectLogFormatter Bug: T149346 Change-Id: If02094df5dd7acc6efd02e540515f8e472ec3d4d --- includes/logging/PatrolLogFormatter.php | 4 +++- includes/logging/ProtectLogFormatter.php | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/includes/logging/PatrolLogFormatter.php b/includes/logging/PatrolLogFormatter.php index 5b933ce269..bbd8badc8a 100644 --- a/includes/logging/PatrolLogFormatter.php +++ b/includes/logging/PatrolLogFormatter.php @@ -22,6 +22,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later * @since 1.22 */ +use MediaWiki\MediaWikiServices; /** * This class formats patrol log entries. @@ -54,7 +55,8 @@ class PatrolLogFormatter extends LogFormatter { 'oldid' => $oldid, 'diff' => 'prev' ]; - $revlink = Linker::link( $target, htmlspecialchars( $revision ), [], $query ); + $revlink = MediaWikiServices::getInstance()->getLinkRenderer()->makeLink( + $target, $revision, [], $query ); } else { $revlink = htmlspecialchars( $revision ); } diff --git a/includes/logging/ProtectLogFormatter.php b/includes/logging/ProtectLogFormatter.php index 0458297190..9e5eea54ca 100644 --- a/includes/logging/ProtectLogFormatter.php +++ b/includes/logging/ProtectLogFormatter.php @@ -21,6 +21,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later * @since 1.26 */ +use MediaWiki\MediaWikiServices; /** * This class formats protect log entries. @@ -77,6 +78,7 @@ class ProtectLogFormatter extends LogFormatter { } public function getActionLinks() { + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); $subtype = $this->entry->getSubtype(); if ( $this->entry->isDeleted( LogPage::DELETED_ACTION ) // Action is hidden || $subtype === 'move_prot' // the move log entry has the right action link @@ -87,8 +89,8 @@ class ProtectLogFormatter extends LogFormatter { // Show history link for all changes after the protection $title = $this->entry->getTarget(); $links = [ - Linker::link( $title, - $this->msg( 'hist' )->escaped(), + $linkRenderer->makeLink( $title, + $this->msg( 'hist' )->text(), [], [ 'action' => 'history', @@ -99,9 +101,9 @@ class ProtectLogFormatter extends LogFormatter { // Show change protection link if ( $this->context->getUser()->isAllowed( 'protect' ) ) { - $links[] = Linker::linkKnown( + $links[] = $linkRenderer->makeKnownLink( $title, - $this->msg( 'protect_change' )->escaped(), + $this->msg( 'protect_change' )->text(), [], [ 'action' => 'protect' ] ); -- 2.20.1