From 809ab03c48bb5bf5bccbaa876970f329e6e2ccaf Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Fri, 28 Jan 2011 01:09:47 +0000 Subject: [PATCH] Add the resolved URL of each langlink to the API's action=parse output --- includes/api/ApiParse.php | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- 2.20.1