API: Include ApiMain construction in api.php try-catch block
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 22 Oct 2014 21:26:40 +0000 (17:26 -0400)
committerReedy <reedy@wikimedia.org>
Thu, 23 Oct 2014 14:39:50 +0000 (14:39 +0000)
commitae5cfdb1256a83b0ed43b8bed94794e3ff5471c5
tree82fe17f113e00975f3fa8898714c3ac166de882d
parentbba2dad6267951e8baf579b85c225d03e6811524
API: Include ApiMain construction in api.php try-catch block

If the User language is accessed from ApiMain::__construct on a request
via OAuth and the authorization headers weren't valid, the
UsageException was not being handled.

Further, the code setting $wgLang in that constructor should be using
the language just set on the local context, not the main request
context.

Bug: 72384
Change-Id: I90900dc4a8aea22c67c0c05b38128d5dbb044f07
api.php
includes/api/ApiMain.php