aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiOptions.php
Commit message (Collapse)AuthorAgeFilesLines
...
* API: Remove action=paraminfo 'props' and 'errors' result propertiesBrad Jorsch2014-08-071-19/+0
| | | | | | | | | | | | | | | | | The format for 'props' was never specified and the list for 'errors' is impossible to keep updated when considering that many errors come from MediaWiki backend code and extension hook functions. And since there doesn't seem to be any real use case for either of these, let's just kill both of them instead of wasting effort on trying to fix them. Note that neither getResultProperties nor getPossibleErrors are called from any extensions in gerrit, and none of the other deprecated methods are called outside of the implementations of those two methods. Removing the obsolete methods is left to the maintainers of the extensions, as keeping them hurts nothing and is needed to maintain compatibility with earlier versions of MediaWiki. Change-Id: Ie11a401d60c834059fbf1b5625ca8ea093b3337c
* Add final period to API module descriptionsaddshore2014-03-101-2/+2
| | | | Change-Id: Icae68c1ab1fd0006e00a3a9a56ae8f831d3d0d45
* Merge "Remove final period from api module descriptions"jenkins-bot2014-03-091-1/+1
|\
| * Remove final period from api module descriptionsumherirrender2014-03-021-1/+1
| | | | | | | | | | | | The most description are without a final period, so that looks common. Change-Id: If72a3cc094cfff436b53948728354cbaeff768c8
* | Wrap long textReedy2014-03-091-3/+4
|/ | | | Change-Id: I37fe6fbdc8779ba86318e587c3d9e217bede400a
* Merge "API: Handle "special" options in action=options"jenkins-bot2014-02-041-0/+3
|\
| * API: Handle "special" options in action=optionsBrad Jorsch2013-10-101-0/+3
| | | | | | | | | | | | | | | | | | There are certain preferences, such as realname and emailaddress, that are handled specially in Special:Preferences and are not accessible by User::getOptions or User::setOptions. But action=options was allowing a 'dummy' version to be set in User::setOptions. Change-Id: I4c1b3d8e1eae9520228d7b6da9c41ada80f7c387
* | Address errors and warnings in CodeSniffer in api/Siebrand Mazeland2013-11-171-5/+10
| | | | | | | | Change-Id: I06de371393d50eada33154626874b106d814642b
* | Pass Context to User::resetOptionsumherirrender2013-10-121-1/+1
|/ | | | Change-Id: I0444777697ed9a8b8afdd0e5a96841848b162a7a
* No spaces after (casts)MatmaRex2013-09-041-1/+1
| | | | | | | | | | Also removed some unnecessary ones. I think I've caught them all. The spaceless version already appears in core ~300 times (after accounting for false positives when grepping). Some consistency would be nice. Change-Id: I607655b5f4366e66dc78730d5fd2f57ed8776cae
* Add 'viewmyprivateinfo', 'editmyprivateinfo', and 'editmyoptions' rightsBrad Jorsch2013-07-031-0/+4
| | | | | | | | | | | | | | These are needed for OAuth grants. Note that we don't bother with a 'viewmyoptions' right, since the majority will be determinable from just observing the interface. Note that the fact of having a confirmed email address cannot be reliably hidden, and if the user has 'sendemail' they may be able to determine the real name and email address by sending an email to another account that they control. Change-Id: I3f03dd010020e8d43cc2d3bca7b3ef7196d1c548
* Adding validation for checkmatrix (same as for multiselect)Kaldari2013-03-071-1/+2
| | | | Change-Id: I825ec8a6094405cf7d74597a0eeda3898981763b
* Fix align of block commentsumherirrender2013-03-071-3/+3
| | | | Change-Id: I88ea33a125a71671886b49e4ebf4c1d0a1cce572
* api: remove duplicate __contruct callsAntoine Musso2013-01-291-4/+0
| | | | | | | | For historical reasons, all our API class had a dummy __construct which simply calls their parent constructor. This patch removes all such occurences to save out some bytes. Change-Id: I667955d7821f780fc5ce23823d74dedb1729b9fa
* (bug 43959) Add ability to reset certain option kinds in API.Tyler Anthony Romeo2013-01-181-4/+13
| | | | | | | | | | | | Added the "resetkinds" option to action=options, so that when the "reset" option is set, the user can control which kinds of options are reset, rather than having to do all or none. Also added documentation to the "change" parameter, since passing it option keys without any "=value" after it will result in resetting that specific option to its default value. Change-Id: Id5bc1fffa0d487c0f152b79115205d2722f380d3
* (bug 35885) remove api version string and parameterYuri Astrakhan2013-01-181-4/+0
| | | | | | | | | API was using SVN's version keyword which GIT does not support. All related methods were either removed, or for those that could have been used from extensions, emptied out. api.php?version now shows unrecognized param warning. Change-Id: I910ca1448ed2ed697ac19b17c486d130aa1d7e03
* (bug 40124) allow arbitrary user preferences prefixed with 'userjs-'MatmaRex2013-01-131-29/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* (bug 42639) Fix API action=options for multiselect prefsBrad Jorsch2012-12-081-3/+26
| | | | | | | | | | | | | 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
* (bug 42638) Fix API action=options&reset=1 & unit testsBrad Jorsch2012-12-021-1/+1
| | | | | | | | | | | Change I98df55f2 broke action=options&reset=1, causing it to return an error "No changes were requested" rather than resetting the options as it should. Unfortunately, that change also broke the unit test that would have caught this regression. This changeset fixes the bug and the unit tests. Change-Id: I7fe63640d54efab4572538e9d08f5b75c61243a4
* (bug 42202) Validate preference values in action=optionsCatrope2012-11-291-9/+26
| | | | | | | | | | | | 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
* Fix possible error texts in action=optionsumherirrender2012-08-041-2/+2
| | | | Change-Id: I465b9cf109bd4f22542747ca72876caa3725a353
* Add hint for pipe-separated list to action=helpumherirrender2012-07-291-1/+1
| | | | | | Also fix helptext for integer min/max for isMulti param Change-Id: I84caf01ace8eefd9de4fe783a6cafac3201f2e0a
* Added result properties to action=paraminfoPetr Onderka2012-06-061-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added information about the properties of the results of API calls to action=paraminfo, including information about "property groups": what should the prop parameter be set to to get that property. Uses the same format for types as parameters already do. The output format of some modules doesn't fit this, so the result properties for them weren't added, or only partially. Partially implemented modules: * expandtemplates: parsetree is in its own tag * protect, allusers, backlinks, deletedrevs, info, imageinfo, logevents, querypage, recentchanges, revisions, searchinfo, usercontribs, userinfo, users, watchlist, upload: response with partially complex structure Not implemented modules: * feedcontributions, feedwatchlist, opensearch, rds: non-standard reponse * help: error is normal response; not very useful for automated tools anyway * paraminfo, parse, pageprops, siteinfo, userrights: response with complex structure Change-Id: Iff2a9bef79f994e73eef3062b4dd5461bff968ab
* Move optionstoken from meta=userinfo to action=tokens.Szymon Świerkosz2012-05-061-1/+5
| | | | | | | Follow up to I0d6c654a7354ba77e65e338423952a6a78c1150f. I have also added a URL to a help page on mw.org. Change-Id: Ie223930cfc313aff150e2dcfd70b74bf4360a8a8
* (bug 18195) Allow changing preferences via APISzymon Świerkosz2012-04-201-0/+150
I have created an API module for changing the preferences. It allows resetting preferences (reset argument) and bulk changes of preferences (change argument) in a format: name1=value1|name2=value2 The change argument has a limitation imposed by the current API implementation as it cannot accept | in values. There is available a pair of arguments optionname and optionvalue, the latter accepts values with |. I have created optionstoken parameter in meta=userinfo to provide a token. There is already preferencestoken there, but I would like to have a consistent naming. Change-Id: I0d6c654a7354ba77e65e338423952a6a78c1150f