From 9db190c7e736ec8d063187d4241b59feaf7dc2d1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 22 Jun 2011 11:28:20 +0200 Subject: update to MediaWiki 1.17.0 --- includes/specials/SpecialDisambiguations.php | 33 ++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'includes/specials/SpecialDisambiguations.php') diff --git a/includes/specials/SpecialDisambiguations.php b/includes/specials/SpecialDisambiguations.php index 1941112a..3e706189 100644 --- a/includes/specials/SpecialDisambiguations.php +++ b/includes/specials/SpecialDisambiguations.php @@ -1,10 +1,29 @@ $disPageObj->getNamespace(), 'page_title' => $disPageObj->getDBkey()), __METHOD__ ); - while ( $row = $dbr->fetchObject( $res ) ) { + foreach ( $res as $row ) { $linkBatch->addObj( Title::makeTitle( NS_TEMPLATE, $row->pl_title )); } - - $dbr->freeResult( $res ); } $set = $linkBatch->constructSet( 'lb.tl', $dbr ); @@ -64,12 +83,18 @@ class DisambiguationsPage extends PageQueryPage { list( $page, $pagelinks, $templatelinks) = $dbr->tableNamesN( 'page', 'pagelinks', 'templatelinks' ); + if ( $wgContentNamespaces ) { + $nsclause = 'IN (' . $dbr->makeList( $wgContentNamespaces ) . ')'; + } else { + $nsclause = '= ' . NS_MAIN; + } + $sql = "SELECT 'Disambiguations' AS \"type\", pb.page_namespace AS namespace," ." pb.page_title AS title, la.pl_from AS value" ." FROM {$templatelinks} AS lb, {$page} AS pb, {$pagelinks} AS la, {$page} AS pa" ." WHERE $set" # disambiguation template(s) .' AND pa.page_id = la.pl_from' - .' AND pa.page_namespace = ' . NS_MAIN # Limit to just articles in the main namespace + .' AND pa.page_namespace ' . $nsclause .' AND pb.page_id = lb.tl_from' .' AND pb.page_namespace = la.pl_namespace' .' AND pb.page_title = la.pl_title' -- cgit v1.2.2