* (bug 26006) prop=langlinks now allows obtaining full URL
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 21 Nov 2010 14:04:10 +0000 (14:04 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 21 Nov 2010 14:04:10 +0000 (14:04 +0000)
RELEASE-NOTES
includes/api/ApiQueryLangLinks.php

index 80afa03..24068cd 100644 (file)
@@ -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 ===
 
index f16e804..c2ae0f5 100644 (file)
@@ -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',
                );
        }