(bug 42202) Validate preference values in action=options
authorCatrope <roan.kattouw@gmail.com>
Fri, 16 Nov 2012 18:19:15 +0000 (10:19 -0800)
committercsteipp <csteipp@wikimedia.org>
Fri, 30 Nov 2012 00:42:56 +0000 (16:42 -0800)
commitfe45ba87528d855b4f12785016280451bd7893cf
treeda80350c34943a8aad20c7fff0bfaa495cfa15a6
parent8e57acf21152a688dcb147e6e2bf5c97ef6860af
(bug 42202) Validate preference values in action=options

Previously, there was no validation whatsoever and the module would
happily write any preference you asked it to. This, combined with the
fact that the code using the 'editfont' preference didn't perform any
validation or escaping, led to a CSS injection vulnerability.

Using Preferences::getPreferences breaks some existing test cases
because a MockUser doesn't have groups for preferences.

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