Victorbarbu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324680

Change subject: Replace some of the Linker::link occurrences in special pages
......................................................................

Replace some of the Linker::link occurrences in special pages

Bug: T149346
Change-Id: I13358b6bfa70faf89e3d0ba8aaf66ed5dad5570a
---
M includes/specials/SpecialFileDuplicateSearch.php
M includes/specials/SpecialMIMEsearch.php
M includes/specials/SpecialMostcategories.php
M includes/specials/SpecialMostinterwikis.php
M includes/specials/SpecialWantedcategories.php
5 files changed, 11 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/80/324680/1

diff --git a/includes/specials/SpecialFileDuplicateSearch.php 
b/includes/specials/SpecialFileDuplicateSearch.php
index 6de127d..7d32e03 100644
--- a/includes/specials/SpecialFileDuplicateSearch.php
+++ b/includes/specials/SpecialFileDuplicateSearch.php
@@ -210,7 +210,7 @@
 
                $nt = $result->getTitle();
                $text = $wgContLang->convert( $nt->getText() );
-               $plink = Linker::link(
+               $plink = $this->getLinkRenderer()->makeLink(
                        $nt,
                        htmlspecialchars( $text )
                );
diff --git a/includes/specials/SpecialMIMEsearch.php 
b/includes/specials/SpecialMIMEsearch.php
index 1d02a4f..d8f6bc7 100644
--- a/includes/specials/SpecialMIMEsearch.php
+++ b/includes/specials/SpecialMIMEsearch.php
@@ -153,9 +153,10 @@
        function formatResult( $skin, $result ) {
                global $wgContLang;
 
+               $linkRenderer = $this->getLinkRenderer();
                $nt = Title::makeTitle( $result->namespace, $result->title );
                $text = $wgContLang->convert( $nt->getText() );
-               $plink = Linker::link(
+               $plink = $linkRenderer->makeLink(
                        Title::newFromText( $nt->getPrefixedText() ),
                        htmlspecialchars( $text )
                );
@@ -166,7 +167,7 @@
                $bytes = htmlspecialchars( $lang->formatSize( $result->img_size 
) );
                $dimensions = $this->msg( 'widthheight' )->numParams( 
$result->img_width,
                        $result->img_height )->escaped();
-               $user = Linker::link(
+               $user = $linkRenderer->makeLink(
                        Title::makeTitle( NS_USER, $result->img_user_text ),
                        htmlspecialchars( $result->img_user_text )
                );
diff --git a/includes/specials/SpecialMostcategories.php 
b/includes/specials/SpecialMostcategories.php
index 015701d..287d69d 100644
--- a/includes/specials/SpecialMostcategories.php
+++ b/includes/specials/SpecialMostcategories.php
@@ -91,11 +91,7 @@
                        );
                }
 
-               if ( $this->isCached() ) {
-                       $link = Linker::link( $title );
-               } else {
-                       $link = Linker::linkKnown( $title );
-               }
+               $link = $this->getLinkRenderer()->makeLink( $title );
 
                $count = $this->msg( 'ncategories' )->numParams( $result->value 
)->escaped();
 
diff --git a/includes/specials/SpecialMostinterwikis.php 
b/includes/specials/SpecialMostinterwikis.php
index 3e78352..210c4a2 100644
--- a/includes/specials/SpecialMostinterwikis.php
+++ b/includes/specials/SpecialMostinterwikis.php
@@ -97,10 +97,11 @@
                        );
                }
 
+               $linkRenderer = $this->getLinkRenderer();
                if ( $this->isCached() ) {
-                       $link = Linker::link( $title );
+                       $link = $linkRenderer->makeLink( $title );
                } else {
-                       $link = Linker::linkKnown( $title );
+                       $link = $linkRenderer->makeKnownLink( $title );
                }
 
                $count = $this->msg( 'ninterwikis' )->numParams( $result->value 
)->escaped();
diff --git a/includes/specials/SpecialWantedcategories.php 
b/includes/specials/SpecialWantedcategories.php
index 9bf44ad..48766b1 100644
--- a/includes/specials/SpecialWantedcategories.php
+++ b/includes/specials/SpecialWantedcategories.php
@@ -90,21 +90,16 @@
        function formatResult( $skin, $result ) {
                global $wgContLang;
 
+               $linkRenderer = $this->getLinkRenderer();
                $nt = Title::makeTitle( $result->namespace, $result->title );
                $text = htmlspecialchars( $wgContLang->convert( $nt->getText() 
) );
 
                if ( !$this->isCached() ) {
                        // We can assume the freshest data
-                       $plink = Linker::link(
-                               $nt,
-                               $text,
-                               [],
-                               [],
-                               [ 'broken' ]
-                       );
+                       $plink = $linkRenderer->makeBrokenLink( $nt, $text );
                        $nlinks = $this->msg( 'nmembers' )->numParams( 
$result->value )->escaped();
                } else {
-                       $plink = Linker::link( $nt, $text );
+                       $plink = $linkRenderer->makeLink( $nt, $text );
 
                        $currentValue = isset( 
$this->currentCategoryCounts[$result->title] )
                                ? $this->currentCategoryCounts[$result->title]

-- 
To view, visit https://gerrit.wikimedia.org/r/324680
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I13358b6bfa70faf89e3d0ba8aaf66ed5dad5570a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Victorbarbu <victorbarb...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to