wiki.techinc.nl/tests/phpunit/includes/api
MatmaRex 733d19d0d0 (bug 40124) allow arbitrary user preferences prefixed with 'userjs-'
Before change I98df55f2 it was possible to set arbitrary preferences (ie.
with anything as the key) using the action=options API. That change
removed this ability by enforcing full validation of the preferences, also
introducing several regressions which were fixed by follow-ups.

Per the discussion on bug 40124, this changeset aims to restore this
ability, but in a slightly restricted way: arbitrary preferences' names
must start with userjs- prefix, to avoid any possibility of conflicting
with new MediaWiki versions or extensions.

The contents of these preferences is not escaped, sanitized nor validated
in any way; script authors are expected to sanitize them themselves to
prevent XSS attacks and other security vulnerabilities.

This commit also adds the User::getOptionsKinds() method (to determine
whether given preference keys are used by MediaWiki itself or an extension,
intended to be used via the API, or entirely unknown) and enhances the
User::resetOptions() method to allow for resetting only preferences of
chosen kinds.

These changes allow for fixing of Special:Preferences not to clear those
additional fields when saving user settings.

Change-Id: I5f9ba5b0dfe7c2ea5458d836f03429cf6d93969d
2013-01-13 19:08:56 +01:00
..
format
ApiAccountCreationTest.php raise timeout for ApiCreateAccountTest::testValid 2013-01-11 10:46:18 +01:00
ApiBlockTest.php Clean and repair many phpunit tests (+ fix implied configuration) 2012-10-09 03:01:51 +02:00
ApiEditPageTest.php mark ApiEditPageTest as being slow tests 2012-11-26 14:49:52 +01:00
ApiGeneratorTest.php ApiOptionsTest: Group medium (takes more than 2 seconds). 2012-12-28 18:23:02 +01:00
ApiOptionsTest.php (bug 40124) allow arbitrary user preferences prefixed with 'userjs-' 2013-01-13 19:08:56 +01:00
ApiParseTest.php (bug 41042) Regression: API action=parse with nonexistent page 2012-10-29 13:38:33 -04:00
ApiPurgeTest.php Clean and repair many phpunit tests (+ fix implied configuration) 2012-10-09 03:01:51 +02:00
ApiQueryRevisionsTest.php When returning rev content, always include model. 2012-11-14 14:53:34 +01:00
ApiQueryTest.php Clean and repair many phpunit tests (+ fix implied configuration) 2012-10-09 03:01:51 +02:00
ApiTest.php Less wild whitespace 2012-12-07 21:44:53 +00:00
ApiTestCase.php Some cleanup of doApiRequest in test module 2012-11-01 18:36:10 +01:00
ApiTestCaseUpload.php Clean and repair many phpunit tests (+ fix implied configuration) 2012-10-09 03:01:51 +02:00
ApiUploadTest.php Regroup all API tests in the 'API' PHPUnit group 2012-04-02 16:55:31 +02:00
ApiWatchTest.php Merge branch 'Wikidata' into master. 2012-10-09 11:34:24 +02:00
generateRandomImages.php merged master 2012-08-29 15:20:15 +02:00
PrefixUniquenessTest.php ApiOptionsTest: Group medium (takes more than 2 seconds). 2012-12-28 18:23:02 +01:00
RandomImageGenerator.php merged master 2012-08-29 15:20:15 +02:00
words.txt