summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialMostlinked.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialMostlinked.php')
-rw-r--r--includes/specials/SpecialMostlinked.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/includes/specials/SpecialMostlinked.php b/includes/specials/SpecialMostlinked.php
index a16f0872..89c43509 100644
--- a/includes/specials/SpecialMostlinked.php
+++ b/includes/specials/SpecialMostlinked.php
@@ -42,13 +42,13 @@ class MostlinkedPage extends QueryPage {
function getQueryInfo() {
return array (
'tables' => array ( 'pagelinks', 'page' ),
- 'fields' => array ( 'pl_namespace AS namespace',
- 'pl_title AS title',
- 'COUNT(*) AS value',
+ 'fields' => array ( 'namespace' => 'pl_namespace',
+ 'title' => 'pl_title',
+ 'value' => 'COUNT(*)',
'page_namespace' ),
'options' => array ( 'HAVING' => 'COUNT(*) > 1',
- 'GROUP BY' => 'pl_namespace, pl_title, '.
- 'page_namespace' ),
+ 'GROUP BY' => array( 'pl_namespace', 'pl_title',
+ 'page_namespace' ) ),
'join_conds' => array ( 'page' => array ( 'LEFT JOIN',
array ( 'page_namespace = pl_namespace',
'page_title = pl_title' ) ) )
@@ -62,12 +62,12 @@ class MostlinkedPage extends QueryPage {
* @param $res
*/
function preprocessResults( $db, $res ) {
- if( $db->numRows( $res ) > 0 ) {
+ if ( $res->numRows() > 0 ) {
$linkBatch = new LinkBatch();
foreach ( $res as $row ) {
$linkBatch->add( $row->namespace, $row->title );
}
- $db->dataSeek( $res, 0 );
+ $res->seek( 0 );
$linkBatch->execute();
}
}
@@ -94,7 +94,8 @@ class MostlinkedPage extends QueryPage {
function formatResult( $skin, $result ) {
$title = Title::makeTitleSafe( $result->namespace, $result->title );
if ( !$title ) {
- return '<!-- ' . htmlspecialchars( "Invalid title: [[$title]]" ) . ' -->';
+ return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
+ Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) );
}
$link = Linker::link( $title );
$wlh = $this->makeWlhLink( $title,