From 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Dec 2013 09:55:49 +0100 Subject: Update to MediaWiki 1.22.0 --- includes/api/ApiPageSet.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'includes/api/ApiPageSet.php') diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php index 074efe4b..b05cb2b6 100644 --- a/includes/api/ApiPageSet.php +++ b/includes/api/ApiPageSet.php @@ -69,6 +69,9 @@ class ApiPageSet extends ApiBase { private $mFakePageId = -1; private $mCacheMode = 'public'; private $mRequestedPageFields = array(); + /** + * @var int + */ private $mDefaultNamespace = NS_MAIN; /** @@ -149,7 +152,6 @@ class ApiPageSet extends ApiBase { if ( !$isDryRun ) { $generator->executeGenerator( $this ); wfRunHooks( 'APIQueryGeneratorAfterExecute', array( &$generator, &$this ) ); - $this->resolvePendingRedirects(); } else { // Prevent warnings from being reported on these parameters $main = $this->getMain(); @@ -160,6 +162,10 @@ class ApiPageSet extends ApiBase { $generator->profileOut(); $this->profileIn(); + if ( !$isDryRun ) { + $this->resolvePendingRedirects(); + } + if ( !$isQuery ) { // If this pageset is not part of the query, we called profileIn() above $dbSource->profileOut(); @@ -185,7 +191,7 @@ class ApiPageSet extends ApiBase { if ( !$isDryRun ) { // Populate page information with the original user input - switch( $dataSource ) { + switch ( $dataSource ) { case 'titles': $this->initFromTitles( $this->mParams['titles'] ); break; @@ -404,7 +410,7 @@ class ApiPageSet extends ApiBase { * @return array of raw_prefixed_title (string) => prefixed_title (string) * @since 1.21 */ - public function getNormalizedTitlesAsResult( $result = null ) { + public function getNormalizedTitlesAsResult( $result = null ) { $values = array(); foreach ( $this->getNormalizedTitles() as $rawTitleStr => $titleStr ) { $values[] = array( @@ -595,13 +601,13 @@ class ApiPageSet extends ApiBase { } foreach ( $this->mRequestedPageFields as $fieldName => &$fieldValues ) { - $fieldValues[$pageId] = $row-> $fieldName; + $fieldValues[$pageId] = $row->$fieldName; } } /** * Do not use, does nothing, will be removed - * @deprecated 1.21 + * @deprecated since 1.21 */ public function finishPageSetGeneration() { wfDeprecated( __METHOD__, '1.21' ); @@ -859,7 +865,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; -- cgit v1.2.3-54-g00ecf