From ec9296e42f2f33842a4ee61b87a0cc5e3c071f1c Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 11 May 2013 20:44:55 +0200 Subject: [PATCH] Do not returning external title in ApiPageSet::getRedirectTargets Having a page with a redirect to "en:Main Page" will be added as "Main Page" to the output, that is wrong http://test.wikipedia.org/w/api.php?action=query&titles=Redirect%20to%20interwiki%20page&redirects Change-Id: I7b59f592c1293dbb96f4c4279201bf04fcfea29d --- includes/api/ApiPageSet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php index fbe597342f..9fdad2ba38 100644 --- a/includes/api/ApiPageSet.php +++ b/includes/api/ApiPageSet.php @@ -862,7 +862,7 @@ class ApiPageSet extends ApiBase { $from = $this->mPendingRedirectIDs[$rdfrom]->getPrefixedText(); $to = Title::makeTitle( $row->rd_namespace, $row->rd_title, $row->rd_fragment, $row->rd_interwiki ); unset( $this->mPendingRedirectIDs[$rdfrom] ); - if ( !isset( $this->mAllPages[$row->rd_namespace][$row->rd_title] ) ) { + if ( !$to->isExternal() && !isset( $this->mAllPages[$row->rd_namespace][$row->rd_title] ) ) { $lb->add( $row->rd_namespace, $row->rd_title ); } $this->mRedirectTitles[$from] = $to; -- 2.20.1