X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialMostlinkedtemplates.php;h=0b587dcf9f9afee4448cc434c06274ba7cacc717;hb=cd06070fbfeee94513cf826467a8aacc33d2acbf;hp=370ba68b88c3bec6a58cdd7480cd9cbfa06dc12a;hpb=cf11d9d95b158a640d957520c9ffd866a554126f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialMostlinkedtemplates.php b/includes/specials/SpecialMostlinkedtemplates.php index 370ba68b88..0b587dcf9f 100644 --- a/includes/specials/SpecialMostlinkedtemplates.php +++ b/includes/specials/SpecialMostlinkedtemplates.php @@ -79,13 +79,17 @@ class MostlinkedTemplatesPage extends QueryPage { * @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 ),