r81121 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81120‎ | r81121 | r81122 >
Date:01:09, 28 January 2011
Author:catrope
Status:ok
Tags:
Comment:
Add the resolved URL of each langlink to the API's action=parse output
Modified paths:
  • /trunk/phase3/includes/api/ApiParse.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiParse.php
@@ -324,7 +324,12 @@
325325 foreach ( $links as $link ) {
326326 $entry = array();
327327 $bits = explode( ':', $link, 2 );
 328+ $title = Title::newFromText( $link );
 329+
328330 $entry['lang'] = $bits[0];
 331+ if ( $title ) {
 332+ $entry['url'] = $title->getFullURL();
 333+ }
329334 $this->getResult()->setContent( $entry, $bits[1] );
330335 $result[] = $entry;
331336 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r814071.17: MFT r79454, r79455, r79456, r79536, r79727, r79733, r79773, r79774, r80...catrope19:18, 2 February 2011

Status & tagging log