API: Check assert parameters earlier in the request
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 20 Jun 2018 14:32:03 +0000 (10:32 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Thu, 21 Jun 2018 18:50:47 +0000 (14:50 -0400)
commitd927830935f5eecf13aada330111f2e61e4e3c04
tree450bc8da9b3ccb2e2a4134f4cc87adde1c3fda43
parent1c944a27002167efd982881ab89b7d108106cf98
API: Check assert parameters earlier in the request

Specifically, check the assert and assertuser parameters before setting
up the action module, so errors in parsing the module's parameters due
to being logged out don't override the client's intended "am I logged
in?" check.

Note this means that assertion failures will no longer use custom module
output formatters. This seems like an acceptable tradeoff: on Wikimedia
sites in May 2018 there were no requests that would have been affected
by this change.

Bug: T197672
Change-Id: I02a71395d5ed9f445e57162f2136292825f8dbb5
RELEASE-NOTES-1.32
includes/api/ApiMain.php
tests/phpunit/includes/api/ApiMainTest.php