Rename mw.util.wikiGetlink to getUrl
[lhc/web/wiklou.git] / includes / api / ApiPageSet.php
index fbe5973..b05cb2b 100644 (file)
@@ -152,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();
@@ -163,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();
@@ -862,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;