(bug 42639) Fix API action=options for multiselect prefs
authorBrad Jorsch <bjorsch@wikimedia.org>
Mon, 3 Dec 2012 03:48:57 +0000 (22:48 -0500)
committerMatmaRex <matma.rex@gmail.com>
Sat, 8 Dec 2012 09:09:04 +0000 (10:09 +0100)
commit13f0f58f76b372bca215f03d5c6c006d0fee9ec8
treeb35a18869fe87d4dab7964972da7d3417e33cf9b
parente413fbf1f32da7997eced8eb9f9a7cce204ea863
(bug 42639) Fix API action=options for multiselect prefs

Preferences options using HTMLForm's "multiselect" type are stored in
the user preferences table as one key with a boolean value for each
option in the multiselect. The validation code added in change I98df55f2
does not take this into account, and therefore considers all of these
option keys invalid.

This changeset fixes that, and adds a unit test to verify correct
behavior.

Change-Id: I137c74a6045c7b39e2119a8edde2705738879bc9
includes/api/ApiOptions.php
tests/phpunit/includes/api/ApiOptionsTest.php