/**
* Get a list of redirect resolutions - maps a title to its redirect
* target.
- * @return array prefixed_title (string) => prefixed_title (string)
+ * @return array prefixed_title (string) => Title object
*/
public function getRedirectTitles() {
return $this->mRedirectTitles;
array(
'rd_from',
'rd_namespace',
+ 'rd_fragment',
+ 'rd_interwiki',
'rd_title'
), array( 'rd_from' => array_keys( $this->mPendingRedirectIDs ) ),
__METHOD__
);
$this->profileDBOut();
-
foreach ( $res as $row ) {
$rdfrom = intval( $row->rd_from );
$from = $this->mPendingRedirectIDs[$rdfrom]->getPrefixedText();
- $to = Title::makeTitle( $row->rd_namespace, $row->rd_title )->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] ) ) {
$lb->add( $row->rd_namespace, $row->rd_title );
continue;
}
$lb->addObj( $rt );
- $this->mRedirectTitles[$title->getPrefixedText()] = $rt->getPrefixedText();
+ $this->mRedirectTitles[$title->getPrefixedText()] = $rt;
unset( $this->mPendingRedirectIDs[$id] );
}
}
// Show redirect information
$redirValues = array();
- foreach ( $pageSet->getRedirectTitles() as $titleStrFrom => $titleStrTo ) {
- $redirValues[] = array(
+ foreach ( $pageSet->getRedirectTitles() as $titleStrFrom => $titleTo ) {
+ $r = array(
'from' => strval( $titleStrFrom ),
- 'to' => $titleStrTo
+ 'to' => $titleTo->getPrefixedText(),
);
+ if ( $titleTo->getFragment() !== '' ) {
+ $r['tofragment'] = $titleTo->getFragment();
+ }
+ $redirValues[] = $r;
}
if ( count( $redirValues ) ) {