Index: trunk/phase3/includes/api/ApiQuery.php |
— | — | @@ -381,11 +381,15 @@ |
382 | 382 | |
383 | 383 | // Show redirect information |
384 | 384 | $redirValues = array(); |
385 | | - foreach ( $pageSet->getRedirectTitles() as $titleStrFrom => $titleStrTo ) { |
386 | | - $redirValues[] = array( |
| 385 | + foreach ( $pageSet->getRedirectTitles() as $titleStrFrom => $titleTo ) { |
| 386 | + $r = array( |
387 | 387 | 'from' => strval( $titleStrFrom ), |
388 | | - 'to' => $titleStrTo |
| 388 | + 'to' => $titleTo->getPrefixedText(), |
389 | 389 | ); |
| 390 | + if ( $titleTo->getFragment() !== '' ) { |
| 391 | + $r['tofragment'] = $titleTo->getFragment(); |
| 392 | + } |
| 393 | + $redirValues[] = $r; |
390 | 394 | } |
391 | 395 | |
392 | 396 | if ( count( $redirValues ) ) { |
Index: trunk/phase3/includes/api/ApiPageSet.php |
— | — | @@ -212,7 +212,7 @@ |
213 | 213 | /** |
214 | 214 | * Get a list of redirect resolutions - maps a title to its redirect |
215 | 215 | * target. |
216 | | - * @return array prefixed_title (string) => prefixed_title (string) |
| 216 | + * @return array prefixed_title (string) => Title object |
217 | 217 | */ |
218 | 218 | public function getRedirectTitles() { |
219 | 219 | return $this->mRedirectTitles; |
— | — | @@ -610,16 +610,17 @@ |
611 | 611 | array( |
612 | 612 | 'rd_from', |
613 | 613 | 'rd_namespace', |
| 614 | + 'rd_fragment', |
| 615 | + 'rd_interwiki', |
614 | 616 | 'rd_title' |
615 | 617 | ), array( 'rd_from' => array_keys( $this->mPendingRedirectIDs ) ), |
616 | 618 | __METHOD__ |
617 | 619 | ); |
618 | 620 | $this->profileDBOut(); |
619 | | - |
620 | 621 | foreach ( $res as $row ) { |
621 | 622 | $rdfrom = intval( $row->rd_from ); |
622 | 623 | $from = $this->mPendingRedirectIDs[$rdfrom]->getPrefixedText(); |
623 | | - $to = Title::makeTitle( $row->rd_namespace, $row->rd_title )->getPrefixedText(); |
| 624 | + $to = Title::makeTitle( $row->rd_namespace, $row->rd_title, $row->rd_fragment, $row->rd_interwiki ); |
624 | 625 | unset( $this->mPendingRedirectIDs[$rdfrom] ); |
625 | 626 | if ( !isset( $this->mAllPages[$row->rd_namespace][$row->rd_title] ) ) { |
626 | 627 | $lb->add( $row->rd_namespace, $row->rd_title ); |
— | — | @@ -638,7 +639,7 @@ |
639 | 640 | continue; |
640 | 641 | } |
641 | 642 | $lb->addObj( $rt ); |
642 | | - $this->mRedirectTitles[$title->getPrefixedText()] = $rt->getPrefixedText(); |
| 643 | + $this->mRedirectTitles[$title->getPrefixedText()] = $rt; |
643 | 644 | unset( $this->mPendingRedirectIDs[$id] ); |
644 | 645 | } |
645 | 646 | } |