From 04fe035d5a106a6958a6c5b5d2bc6689ba3e84c2 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Fri, 25 Jul 2008 19:19:11 +0000 Subject: [PATCH] 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. --- includes/specials/SpecialMovepage.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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(), -- 2.20.1