API: Allow fetching login token from action=query&meta=tokens on private wikis
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 16 Mar 2016 14:34:40 +0000 (10:34 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Fri, 18 Mar 2016 21:11:40 +0000 (17:11 -0400)
commit02cc80c51487e8f277b17c10bbc037f3ee3268c5
tree07e0d676c5e93a7ff1296011266e8bd38b23f586
parent26cf9f6ed9e722ec6ed34c9022e97b823ec51343
API: Allow fetching login token from action=query&meta=tokens on private wikis

The problem is that ApiQuery requires the 'read' right even though
ApiQueryTokens doesn't.

So, we introduce an exception: if action=query gets only meta=tokens
(and optionally rawcontinue and indexpageids, since they don't affect
anything), no other modules and nothing in the ApiPageSet,
ApiQuery::isReadMode() will return false.

Bug: T130112
Change-Id: I83dafb0305ff0cb1fc3bac668b88b5d2022e5880
includes/api/ApiQuery.php