From: umherirrender Date: Sat, 11 May 2013 18:44:55 +0000 (+0200) Subject: Do not returning external title in ApiPageSet::getRedirectTargets X-Git-Tag: 1.31.0-rc.0~19606 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/rappels.php?a=commitdiff_plain;h=ec9296e42f2f33842a4ee61b87a0cc5e3c071f1c;p=lhc%2Fweb%2Fwiklou.git 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 --- 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;