From: Roan Kattouw Date: Mon, 3 Sep 2007 20:17:53 +0000 (+0000) Subject: (bug 10898) API does not return an edit token for non-existent pages X-Git-Tag: 1.31.0-rc.0~51536 X-Git-Url: http://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=90a3fb90e96857d4aa59468a55b4c415ed4094a6;p=lhc%2Fweb%2Fwiklou.git (bug 10898) API does not return an edit token for non-existent pages --- 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() {