From 63601400e476c6cf43d985f3e7b9864681695ed4 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 18 Jan 2013 16:46:04 +0100 Subject: Update to MediaWiki 1.20.2 this update includes: * adjusted Arch Linux skin * updated FluxBBAuthPlugin * patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024 --- includes/specials/SpecialMostlinkedtemplates.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'includes/specials/SpecialMostlinkedtemplates.php') diff --git a/includes/specials/SpecialMostlinkedtemplates.php b/includes/specials/SpecialMostlinkedtemplates.php index 6fb09426..22932e5c 100644 --- a/includes/specials/SpecialMostlinkedtemplates.php +++ b/includes/specials/SpecialMostlinkedtemplates.php @@ -64,28 +64,32 @@ class MostlinkedTemplatesPage extends QueryPage { public function getQueryInfo() { return array ( 'tables' => array ( 'templatelinks' ), - 'fields' => array ( 'tl_namespace AS namespace', - 'tl_title AS title', - 'COUNT(*) AS value' ), + 'fields' => array ( 'namespace' => 'tl_namespace', + 'title' => 'tl_title', + 'value' => 'COUNT(*)' ), 'conds' => array ( 'tl_namespace' => NS_TEMPLATE ), - 'options' => array( 'GROUP BY' => 'tl_namespace, tl_title' ) + 'options' => array( 'GROUP BY' => array( 'tl_namespace', 'tl_title' ) ) ); } /** * Pre-cache page existence to speed up link generation * - * @param $db Database connection + * @param $db DatabaseBase connection * @param $res ResultWrapper */ public function preprocessResults( $db, $res ) { + if ( !$res->numRows() ) { + return; + } + $batch = new LinkBatch(); foreach ( $res as $row ) { $batch->add( $row->namespace, $row->title ); } $batch->execute(); - if( $db->numRows( $res ) > 0 ) - $db->dataSeek( $res, 0 ); + + $res->seek( 0 ); } /** @@ -96,7 +100,11 @@ class MostlinkedTemplatesPage extends QueryPage { * @return String */ public function formatResult( $skin, $result ) { - $title = Title::makeTitle( $result->namespace, $result->title ); + $title = Title::makeTitleSafe( $result->namespace, $result->title ); + if ( !$title ) { + return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ), + Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) ); + } return $this->getLanguage()->specialList( Linker::link( $title ), -- cgit v1.2.3-54-g00ecf