Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/158609

Change subject: APIQueryInfo: Allow fetching the canonical url of a page
......................................................................

APIQueryInfo: Allow fetching the canonical url of a page

Change-Id: If0f62481d059815390b74ccf8167957bc1dbce52
---
M includes/api/ApiQueryInfo.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/09/158609/1

diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php
index 3ac9c8a..d7037e3 100644
--- a/includes/api/ApiQueryInfo.php
+++ b/includes/api/ApiQueryInfo.php
@@ -458,6 +458,7 @@
                if ( $this->fld_url ) {
                        $pageInfo['fullurl'] = wfExpandUrl( 
$title->getFullURL(), PROTO_CURRENT );
                        $pageInfo['editurl'] = wfExpandUrl( $title->getFullURL( 
'action=edit' ), PROTO_CURRENT );
+                       $pageInfo['canonicalurl'] = wfExpandUrl( 
$title->getFullURL(), PROTO_CANONICAL );
                }
                if ( $this->fld_readable && $title->userCan( 'read', 
$this->getUser() ) ) {
                        $pageInfo['readable'] = '';
@@ -837,7 +838,7 @@
                                ' watchers              - The number of 
watchers, if allowed',
                                ' notificationtimestamp - The watchlist 
notification timestamp of each page',
                                ' subjectid             - The page ID of the 
parent page for each talk page',
-                               ' url                   - Gives a full URL to 
the page, and also an edit URL',
+                               ' url                   - Gives a full URL, an 
edit URL, and the canonical URL for each page',
                                ' readable              - Whether the user can 
read this page',
                                ' preload               - Gives the text 
returned by EditFormPreloadText',
                                ' displaytitle          - Gives the way the 
page title is actually displayed',

-- 
To view, visit https://gerrit.wikimedia.org/r/158609
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If0f62481d059815390b74ccf8167957bc1dbce52
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to