parent::__construct( $name );
}
- function isExpensive() { return true; }
- function isSyndicated() { return false; }
+ function isExpensive() {
+ return true;
+ }
+
+ function isSyndicated() {
+ return false;
+ }
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' => array( 'pl_namespace', 'pl_title',
* @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();
}
}
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,