numRows() ) { return; } $batch = new LinkBatch(); foreach ( $res as $row ) { $batch->add( $row->namespace, $row->title ); } $batch->execute(); $res->seek( 0 ); } /** * Format the result as a simple link to the page * * @param Skin $skin * @param object $row Result row * @return string */ public function formatResult( $skin, $row ) { global $wgContLang; $title = Title::makeTitleSafe( $row->namespace, $row->title ); if ( $title instanceof Title ) { $text = $wgContLang->convert( $title->getPrefixedText() ); return Linker::link( $title, htmlspecialchars( $text ) ); } else { return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ), Linker::getInvalidTitleDescription( $this->getContext(), $row->namespace, $row->title ) ); } } }