r80394 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80393‎ | r80394 | r80395 >
Date:13:13, 15 January 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Do the title construction in a smarter way. Linker can now add mw-redirect class to links. Kept the old div wrapper for compatibility.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialAllpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialAllpages.php
@@ -320,7 +320,7 @@
321321 }
322322
323323 $res = $dbr->select( 'page',
324 - array( 'page_namespace', 'page_title', 'page_is_redirect' ),
 324+ array( 'page_namespace', 'page_title', 'page_is_redirect', 'page_id' ),
325325 $conds,
326326 __METHOD__,
327327 array(
@@ -333,10 +333,10 @@
334334 if( $res->numRows() > 0 ) {
335335 $out = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-chunk' ) );
336336 while( ( $n < $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
337 - $t = Title::makeTitle( $s->page_namespace, $s->page_title );
 337+ $t = Title::newFromRow( $s );
338338 if( $t ) {
339339 $link = ( $s->page_is_redirect ? '<div class="allpagesredirect">' : '' ) .
340 - $sk->linkKnown( $t, htmlspecialchars( $t->getText() ) ) .
 340+ $sk->link( $t ) .
341341 ($s->page_is_redirect ? '</div>' : '' );
342342 } else {
343343 $link = '[[' . htmlspecialchars( $s->page_title ) . ']]';

Status & tagging log