From: Roan Kattouw Date: Fri, 28 Jan 2011 01:09:47 +0000 (+0000) Subject: Add the resolved URL of each langlink to the API's action=parse output X-Git-Tag: 1.31.0-rc.0~32330 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=809ab03c48bb5bf5bccbaa876970f329e6e2ccaf;p=lhc%2Fweb%2Fwiklou.git Add the resolved URL of each langlink to the API's action=parse output --- diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 550082972e..5c5ff56677 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -324,7 +324,12 @@ class ApiParse extends ApiBase { foreach ( $links as $link ) { $entry = array(); $bits = explode( ':', $link, 2 ); + $title = Title::newFromText( $link ); + $entry['lang'] = $bits[0]; + if ( $title ) { + $entry['url'] = $title->getFullURL(); + } $this->getResult()->setContent( $entry, $bits[1] ); $result[] = $entry; }