aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--RELEASE-NOTES1
-rw-r--r--includes/api/ApiQueryLangLinks.php8
2 files changed, 9 insertions, 0 deletions
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 80afa03e2d1e..24068cd9fb35 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 f16e804e9e08..c2ae0f505bfb 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',
);
}