From fc14e794acd6bf4bb58a2f9517f938c847a83c8e Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sun, 21 Nov 2010 14:04:10 +0000 Subject: [PATCH] * (bug 26006) prop=langlinks now allows obtaining full URL --- RELEASE-NOTES | 1 + includes/api/ApiQueryLangLinks.php | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 80afa03e2d..24068cd9fb 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -527,6 +527,7 @@ LocalSettings.php. The specific bugs are listed below in the general notes. * (bug 25760) counter property still reported by the API when $wgDisableCounters enabled * (bug 25987) prop=info&inprop=watched now also works for missing pages +* (bug 26006) prop=langlinks now allows obtaining full URL === Languages updated in 1.17 === diff --git a/includes/api/ApiQueryLangLinks.php b/includes/api/ApiQueryLangLinks.php index f16e804e9e..c2ae0f505b 100644 --- a/includes/api/ApiQueryLangLinks.php +++ b/includes/api/ApiQueryLangLinks.php @@ -87,6 +87,12 @@ class ApiQueryLangLinks extends ApiQueryBase { break; } $entry = array( 'lang' => $row->ll_lang ); + if ( !is_null( $params['url'] ) ) { + $title = Title::newFromText( "{$row->ll_lang}:{$row->ll_title}" ); + if ( $title ) { + $entry = array_merge( $entry, array( 'url' => $title->getFullURL() ) ); + } + } ApiResult::setContent( $entry, $row->ll_title ); $fit = $this->addPageSubItem( $row->ll_from, $entry ); if ( !$fit ) { @@ -110,6 +116,7 @@ class ApiQueryLangLinks extends ApiQueryBase { ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2 ), 'continue' => null, + 'url' => null, ); } @@ -117,6 +124,7 @@ class ApiQueryLangLinks extends ApiQueryBase { return array( 'limit' => 'How many langlinks to return', 'continue' => 'When more results are available, use this to continue', + 'url' => 'Whether to get the full URL', ); } -- 2.20.1