API: Handle Messages in errorArrayToStatus()
authorBrad Jorsch <bjorsch@wikimedia.org>
Fri, 1 Mar 2019 14:49:05 +0000 (09:49 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Fri, 1 Mar 2019 14:53:01 +0000 (09:53 -0500)
commit426df4cd70face4fb9596ddd0c11ef1b83ca9d13
tree0ac8ac2475a29a07c6f916903d92567bd3f26e9c
parent9b4461c1b8027049d575bc66b45a1545bd506188
API: Handle Messages in errorArrayToStatus()

Two bugs here:
* If the error array contains an entry using a Message object instead of
  a string as the key, it'll blow up trying to do
  `self::$blockMsgMap[$error[0]]`.
* If the error array contains a Message object not wrapped in an array,
  it'll blow up trying to do `...(array)$error`.

Bug: T217382
Change-Id: I2a08e02bca0fb194416b3f2e6a1d6192d5c13cb2
includes/api/ApiBase.php
tests/phpunit/includes/api/ApiBaseTest.php