ApiEditPage: Avoid PHP warning
authorBrad Jorsch <bjorsch@wikimedia.org>
Mon, 19 Dec 2016 14:49:59 +0000 (09:49 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Mon, 19 Dec 2016 14:59:06 +0000 (09:59 -0500)
commit0dcf74a46d62558a0a4b9e6b3b2ccbd15fb0e087
treeb703cffef2207ad73c46288f9ed7b77d6932f3c3
parentfbb1f742435c1d1eb3b31bf980e0682fc509b8c2
ApiEditPage: Avoid PHP warning

In cases where $result is non-null but doesn't have the 'spam' key,
constructing the fallback array was raising a PHP warning.

Thinking it over, we should just use a switch instead of making an array
of known fallback messages. It's longer source code, but probably less
real work than constructing an array where only one entry will actually
be used.

Bug: T153590
Change-Id: I50349c56692c4b2f9a8e560a849c36db1082120e
includes/api/ApiEditPage.php