From: Aryeh Gregor Date: Fri, 25 Jul 2008 19:19:11 +0000 (+0000) Subject: Convert subpage move to use TitleArray, just for demonstration. It's only a few... X-Git-Tag: 1.31.0-rc.0~46366 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=04fe035d5a106a6958a6c5b5d2bc6689ba3e84c2;p=lhc%2Fweb%2Fwiklou.git Convert subpage move to use TitleArray, just for demonstration. It's only a few lines' difference in this case, with no actual effect on anything. Finding places where *arrays* of Titles are used would be more fruitful. --- diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index cbf9045113..9f8bd3e89b 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -363,25 +363,26 @@ class MovePageForm { $conds = null; } - $extrapages = array(); + $extraPages = array(); if( !is_null( $conds ) ) { - $extrapages = $dbr->select( 'page', - array( 'page_id', 'page_namespace', 'page_title' ), - $conds, - __METHOD__ + $extraPages = TitleArray::newFromResult( + $dbr->select( 'page', + array( 'page_id', 'page_namespace', 'page_title' ), + $conds, + __METHOD__ + ) ); } $extraOutput = array(); $skin = $wgUser->getSkin(); $count = 1; - foreach( $extrapages as $row ) { - if( $row->page_id == $ot->getArticleId() ) { + foreach( $extraPages as $oldSubpage ) { + if( $oldSubpage->getArticleId() == $ot->getArticleId() ) { # Already did this one. continue; } - $oldSubpage = Title::newFromRow( $row ); $newPageName = preg_replace( '#^'.preg_quote( $ot->getDBKey(), '#' ).'#', $nt->getDBKey(),