dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Update phpCharToUpper.json based on current differences"
[lhc/web/wiklou.git]
/
includes
/
specials
/
SpecialMostlinkedcategories.php
diff --git
a/includes/specials/SpecialMostlinkedcategories.php
b/includes/specials/SpecialMostlinkedcategories.php
index
3ead08a
..
56a701a
100644
(file)
--- a/
includes/specials/SpecialMostlinkedcategories.php
+++ b/
includes/specials/SpecialMostlinkedcategories.php
@@
-24,6
+24,10
@@
* @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
*/
* @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
*/
+use MediaWiki\MediaWikiServices;
+use Wikimedia\Rdbms\IResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
+
/**
* A querypage to show categories ordered in descending order by the pages in them
*
/**
* A querypage to show categories ordered in descending order by the pages in them
*
@@
-56,21
+60,10
@@
class MostlinkedCategoriesPage extends QueryPage {
* Fetch user page links and cache their existence
*
* @param IDatabase $db
* Fetch user page links and cache their existence
*
* @param IDatabase $db
- * @param ResultWrapper $res
+ * @param
I
ResultWrapper $res
*/
function preprocessResults( $db, $res ) {
*/
function preprocessResults( $db, $res ) {
- if ( !$res->numRows() ) {
- return;
- }
-
- $batch = new LinkBatch;
- foreach ( $res as $row ) {
- $batch->add( NS_CATEGORY, $row->title );
- }
- $batch->execute();
-
- // Back to start for display
- $res->seek( 0 );
+ $this->executeLBFromResultWrapper( $res );
}
/**
}
/**
@@
-79,8
+72,6
@@
class MostlinkedCategoriesPage extends QueryPage {
* @return string
*/
function formatResult( $skin, $result ) {
* @return string
*/
function formatResult( $skin, $result ) {
- global $wgContLang;
-
$nt = Title::makeTitleSafe( NS_CATEGORY, $result->title );
if ( !$nt ) {
return Html::element(
$nt = Title::makeTitleSafe( NS_CATEGORY, $result->title );
if ( !$nt ) {
return Html::element(
@@
-93,8
+84,9
@@
class MostlinkedCategoriesPage extends QueryPage {
);
}
);
}
- $text = $wgContLang->convert( $nt->getText() );
- $plink = $this->getLinkRenderer()->makeLink( $nt, $text );
+ $text = MediaWikiServices::getInstance()->getContentLanguage()
+ ->convert( htmlspecialchars( $nt->getText() ) );
+ $plink = $this->getLinkRenderer()->makeLink( $nt, new HtmlArmor( $text ) );
$nlinks = $this->msg( 'nmembers' )->numParams( $result->value )->escaped();
return $this->getLanguage()->specialList( $plink, $nlinks );
$nlinks = $this->msg( 'nmembers' )->numParams( $result->value )->escaped();
return $this->getLanguage()->specialList( $plink, $nlinks );