$this->addTables( 'iwlinks' );
$this->addWhereFld( 'iwl_from', array_keys( $this->getPageSet()->getGoodTitles() ) );
- $url = !is_null( $params['url'] );
- if ( $url ) {
- $this->addTables( 'interwiki' );
- $this->addJoinConds( array( 'interwiki' => array( 'INNER JOIN', 'iw_prefix=iwl_prefix' ) ) );
- $this->addFields( 'iw_url' );
- }
-
if ( !is_null( $params['continue'] ) ) {
$cont = explode( '|', $params['continue'] );
if ( count( $cont ) != 3 ) {
}
$entry = array( 'prefix' => $row->iwl_prefix );
- if ( $url ) {
- $rowUrl = str_replace( '$1', $row->iwl_title, $row->iw_url );
- $entry = array_merge( $entry, array( 'url' => $rowUrl ) );
+ if ( !is_null( $params['url'] ) ) {
+ $title = Title::newFromText( "{$row->iwl_prefix}:{$row->iwl_title}" );
+ if ( $title ) {
+ $entry = array_merge( $entry, array( 'url' => $title->getFullURL() ) );
+ }
}
ApiResult::setContent( $entry, $row->iwl_title );