From 90a3fb90e96857d4aa59468a55b4c415ed4094a6 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 3 Sep 2007 20:17:53 +0000 Subject: [PATCH] (bug 10898) API does not return an edit token for non-existent pages --- RELEASE-NOTES | 1 + includes/api/ApiQueryInfo.php | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index abc8d26d1b..0b44ba7752 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -496,6 +496,7 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API * Added meta=userinfo - logged-in user information, group membership, rights * (bug 11072) Fix regression in API image history query * (bug 11115) Adding SHA1 hash to imageinfo query +* (bug 10898) API does not return an edit token for non-existent pages == Maintenance script changes since 1.10 == diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index 1cacff6f16..518d1232b5 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -134,6 +134,16 @@ class ApiQueryInfo extends ApiQueryBase { 'pages' ), $pageid, $pageInfo); } + + // Get edit tokens for missing titles if requested + // Delete, protect and move tokens are N/A for missing titles anyway + if($tok_edit) + { + $missing = $pageSet->getMissingTitles(); + $res = $result->getData(); + foreach($missing as $pageid => $title) + $res['query']['pages'][$pageid]['edittoken'] = $wgUser->editToken(); + } } protected function getAllowedParams() { -- 2.20.1