r66885 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66884‎ | r66885 | r66886 >
Date:18:34, 25 May 2010
Author:reedy
Status:ok
Tags:
Comment:
Followup r66872

Use title to make interwiki
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryIWLinks.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryIWLinks.php
@@ -55,13 +55,6 @@
5656 $this->addTables( 'iwlinks' );
5757 $this->addWhereFld( 'iwl_from', array_keys( $this->getPageSet()->getGoodTitles() ) );
5858
59 - $url = !is_null( $params['url'] );
60 - if ( $url ) {
61 - $this->addTables( 'interwiki' );
62 - $this->addJoinConds( array( 'interwiki' => array( 'INNER JOIN', 'iw_prefix=iwl_prefix' ) ) );
63 - $this->addFields( 'iw_url' );
64 - }
65 -
6659 if ( !is_null( $params['continue'] ) ) {
6760 $cont = explode( '|', $params['continue'] );
6861 if ( count( $cont ) != 3 ) {
@@ -100,9 +93,11 @@
10194 }
10295 $entry = array( 'prefix' => $row->iwl_prefix );
10396
104 - if ( $url ) {
105 - $rowUrl = str_replace( '$1', $row->iwl_title, $row->iw_url );
106 - $entry = array_merge( $entry, array( 'url' => $rowUrl ) );
 97+ if ( !is_null( $params['url'] ) ) {
 98+ $title = Title::newFromText( "{$row->iwl_prefix}:{$row->iwl_title}" );
 99+ if ( $title ) {
 100+ $entry = array_merge( $entry, array( 'url' => $title->getFullURL() ) );
 101+ }
107102 }
108103
109104 ApiResult::setContent( $entry, $row->iwl_title );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r66872bug 23524 - &url for ApiQueryIWLinks to expand full URLreedy13:33, 25 May 2010

Status & tagging log