Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -101,6 +101,7 @@ |
102 | 102 | * (bug 28002) Internal error in ApiFormatRaw::getMimeType |
103 | 103 | * (bug 26597) Allow toggling of persistent cookies ("remember me") in API |
104 | 104 | action=login |
| 105 | +* (bug 29237) add interwiki target url attribute to api/query/interwiki |
105 | 106 | |
106 | 107 | === Languages updated in 1.19 === |
107 | 108 | |
Index: trunk/phase3/includes/api/ApiQuery.php |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | */ |
51 | 51 | private $mPageSet; |
52 | 52 | |
53 | | - private $params, $redirects, $convertTitles; |
| 53 | + private $params, $redirects, $convertTitles, $iwUrl; |
54 | 54 | |
55 | 55 | private $mQueryPropModules = array( |
56 | 56 | 'info' => 'ApiQueryInfo', |
— | — | @@ -232,6 +232,7 @@ |
233 | 233 | $this->params = $this->extractRequestParams(); |
234 | 234 | $this->redirects = $this->params['redirects']; |
235 | 235 | $this->convertTitles = $this->params['converttitles']; |
| 236 | + $this->iwUrl = $this->params['wurl']; |
236 | 237 | |
237 | 238 | // Create PageSet |
238 | 239 | $this->mPageSet = new ApiPageSet( $this, $this->redirects, $this->convertTitles ); |
— | — | @@ -367,10 +368,15 @@ |
368 | 369 | // Interwiki titles |
369 | 370 | $intrwValues = array(); |
370 | 371 | foreach ( $pageSet->getInterwikiTitles() as $rawTitleStr => $interwikiStr ) { |
371 | | - $intrwValues[] = array( |
| 372 | + $item = array( |
372 | 373 | 'title' => $rawTitleStr, |
373 | | - 'iw' => $interwikiStr |
| 374 | + 'iw' => $interwikiStr, |
374 | 375 | ); |
| 376 | + if ( $this->iwUrl ) { |
| 377 | + $title = Title::newFromText( "{$interwikiStr}:{$rawTitleStr}" ); |
| 378 | + $item['url'] = $title->getFullURL(); |
| 379 | + } |
| 380 | + $intrwValues[] = $item; |
375 | 381 | } |
376 | 382 | |
377 | 383 | if ( count( $intrwValues ) ) { |
— | — | @@ -586,6 +592,7 @@ |
587 | 593 | 'indexpageids' => false, |
588 | 594 | 'export' => false, |
589 | 595 | 'exportnowrap' => false, |
| 596 | + 'iwurl' => false, |
590 | 597 | ); |
591 | 598 | } |
592 | 599 | |
— | — | @@ -672,6 +679,7 @@ |
673 | 680 | 'indexpageids' => 'Include an additional pageids section listing all returned page IDs', |
674 | 681 | 'export' => 'Export the current revisions of all given or generated pages', |
675 | 682 | 'exportnowrap' => 'Return the export XML without wrapping it in an XML result (same format as Special:Export). Can only be used with export', |
| 683 | + 'iwurl' => 'Whether to get the full URL if the title is an interwiki link', |
676 | 684 | ); |
677 | 685 | } |
678 | 686 | |