Index: trunk/phase3/includes/api/ApiQuery.php |
— | — | @@ -374,6 +374,17 @@ |
375 | 375 | 'missing' => '' |
376 | 376 | ); |
377 | 377 | } |
| 378 | + // Report special pages |
| 379 | + foreach ( $pageSet->getSpecialTitles() as $fakeId => $title ) { |
| 380 | + $vals = array(); |
| 381 | + ApiQueryBase::addTitleInfo( $vals, $title ); |
| 382 | + $vals['special'] = ''; |
| 383 | + if ( $title->getNamespace() == NS_SPECIAL && |
| 384 | + !SpecialPage::exists( $title->getText() ) ) { |
| 385 | + $vals['missing'] = ''; |
| 386 | + } |
| 387 | + $pages[$fakeId] = $vals; |
| 388 | + } |
378 | 389 | |
379 | 390 | // Output general page information for found titles |
380 | 391 | foreach ( $pageSet->getGoodTitles() as $pageid => $title ) { |
Index: trunk/phase3/includes/api/ApiPageSet.php |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | |
47 | 47 | private $mAllPages; // [ns][dbkey] => page_id or negative when missing |
48 | 48 | private $mTitles, $mGoodTitles, $mMissingTitles, $mInvalidTitles; |
49 | | - private $mMissingPageIDs, $mRedirectTitles; |
| 49 | + private $mMissingPageIDs, $mRedirectTitles, $mSpecialTitles; |
50 | 50 | private $mNormalizedTitles, $mInterwikiTitles; |
51 | 51 | private $mResolveRedirects, $mPendingRedirectIDs; |
52 | 52 | private $mGoodRevIDs, $mMissingRevIDs; |
— | — | @@ -72,6 +72,7 @@ |
73 | 73 | $this->mInterwikiTitles = array(); |
74 | 74 | $this->mGoodRevIDs = array(); |
75 | 75 | $this->mMissingRevIDs = array(); |
| 76 | + $this->mSpecialTitles = array(); |
76 | 77 | |
77 | 78 | $this->mRequestedPageFields = array(); |
78 | 79 | $this->mResolveRedirects = $resolveRedirects; |
— | — | @@ -245,6 +246,14 @@ |
246 | 247 | public function getMissingRevisionIDs() { |
247 | 248 | return $this->mMissingRevIDs; |
248 | 249 | } |
| 250 | + |
| 251 | + /** |
| 252 | + * Get the list of titles with negative namespace |
| 253 | + * @return array Title |
| 254 | + */ |
| 255 | + public function getSpecialTitles() { |
| 256 | + return $this->mSpecialTitles; |
| 257 | + } |
249 | 258 | |
250 | 259 | /** |
251 | 260 | * Returns the number of revisions (requested with revids= parameter)\ |
— | — | @@ -649,9 +658,10 @@ |
650 | 659 | // This title is an interwiki link. |
651 | 660 | $this->mInterwikiTitles[$titleObj->getPrefixedText()] = $iw; |
652 | 661 | } else { |
653 | | - // Validation |
654 | 662 | if ( $titleObj->getNamespace() < 0 ) { |
655 | | - $this->setWarning( 'No support for special pages has been implemented' ); |
| 663 | + $titleObj = $titleObj->fixSpecialName(); |
| 664 | + $this->mSpecialTitles[$this->mFakePageId] = $titleObj; |
| 665 | + $this->mFakePageId--; |
656 | 666 | } else { |
657 | 667 | $linkBatch->addObj( $titleObj ); |
658 | 668 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -266,7 +266,11 @@ |
267 | 267 | * (bug 22339) Added srwhat=nearmatch to list=search to get a "go" result |
268 | 268 | * (bug 24303) Added new &servedby parameter to all actions which adds the hostname |
269 | 269 | that served the request to the result. It is also added unconditionally on error |
270 | | - |
| 270 | +* (bug 24185) Titles in the Media and Special namespace are now supported for |
| 271 | + title normalization in action=query. Special pages have their name resolved |
| 272 | + to the local alias. |
| 273 | + |
| 274 | + |
271 | 275 | === Languages updated in 1.17 === |
272 | 276 | |
273 | 277 | MediaWiki supports over 330 languages. Many localisations are updated |