aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiPatrol.php
Commit message (Collapse)AuthorAgeFilesLines
* Coding style: Auto-fix MediaWiki.Usage.IsNull.IsNullJames D. Forrester2020-01-101-1/+1
| | | | Change-Id: I90cfe8366c0245c9c67e598d17800684897a4e27
* Use (int) rather than intval()Reedy2019-02-251-1/+1
| | | | | Bug: T216969 Change-Id: I4c06716c83b69d128f26fa7f68736808aa2d3d64
* API: Update query modules for MCRBrad Jorsch2018-07-271-2/+5
| | | | | | | | | | | | | | | | | | | | | | MCR deprecated the Revision class in favor of the broadly similar RevisionRecord, and more interestingly added the concept of multiple content "slots" to revisions. Thus, prop=revisions, prop=deletedrevisions, and so on gain a parameter to specify which slots are wanted. When this new parameter is not specified (and any content-related props are specified), a warning about the legacy format will be issued. The rest of the modules just needed to call methods or use constants on RevisionRecord instead of Revision. ApiQueryDeletedrevs wasn't touched, since it has been deprecated since 1.25 anyway. This also updates a few non-query modules that don't depend on details of editing, diffing, or viewing MCR revisions that haven't been figured out yet. Bug: T200568 Change-Id: I1327d1784f5cedb006cd74df834cf9a560a77a5d
* Remove "Created on" from file header commentsUmherirrender2018-01-261-2/+0
| | | | | | | | | It is the job of git and svn to provide this information/metadata. The form was different, some with short, some with long month name some with leading zero at the day, some without. The year is also present in the Copyright clause Change-Id: If006907b82b9e45f13cfa2e45d41107a95570e1a
* Make API documentation links language awareBaha2017-04-051-1/+1
| | | | | | | | | | | | | | Links generated by the API are now aware of the user's preferred language and will show documents in that language if available. To test, log in to mediawiki.org and set your language preference to 'es', then on an MediaWiki installation with this patch view the generated expanded API help at `api.php?action=help&recursivesubmodules=1&modules=main`. Each link to documentation on mediawiki.org should take you to its translated /es subpage, if one exists. Bug: T104518 Change-Id: I339a1f3ae1bce9d759cf251899d57c32b1def91e
* API: i18n for warnings and errorsBrad Jorsch2016-12-061-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | API warnings and error messages are currently hard-coded English strings. This patch changes that. With a few exceptions, this patch should be compatible with non-updated extensions: * The change to ApiBase::$messageMap will blow up anything trying to mess with it. * The changes to the 'ApiCheckCanExecute' hook will cause a wrong (probably unparsed) error message to be emitted for extensions not already using an ApiMessage. Unless they're currently broken like Wikibase. Bug: T37074 Bug: T47843 Depends-On: Ia2b66b57cd4eaddc30b3ffdd7b97d6ca3e02d898 Depends-On: I2e1bb975bb0045476c03ebe6cdec00259bae22ec Depends-On: I53987bf87c48f6c00deec17a8e957d24fcc3eaa6 Depends-On: Ibf93a459eb62d30f7c70d20e91ec9faeb80d10ed Depends-On: I3cf889811f44a15935e454dd42f081164d4a098c Depends-On: Ieae527de86735ddcba34724730e8730fb277b99b Depends-On: I535344c29d51521147c2a26c341dae38cec3e931 Change-Id: Iae0e2ce3bd42dd4776a9779664086119ac188412
* Add tags support to patrol, protect, unblock, and undeleteGeoffrey Mon2016-02-291-1/+16
| | | | | | | | | | | | - Add 'tags' parameters to appropriate API modules - Add tag-adding logic to appropriate functions that carry out relevant functions - ManualLogEntry::{set,get}Tags to handle adding tags to log entries in a cleaner fashion - Use ManualLogEntry::setTags in LocalFile::recordUpload2 Bug: T97720 Change-Id: I98c52da7985623bfdafda2dc2dae937b39b72419
* Convert all array() syntax to []Kunal Mehta2016-02-171-11/+11
| | | | | | | | | | Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html Notes: * Disabled CallTimePassByReference due to false positives (T127163) Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
* Fix case of various newFromID/newFromId functionsumherirrender2014-12-101-1/+1
| | | | | | | | | | | | User::newFromID -> User::newFromId Revision::newFromID -> Revision::newFromId RecentChange::newFromID -> RecentChange::newFromId WikiPage::newFromId -> WikiPage::newFromID Title::newFromId -> Title::newFromID Change-Id: I310f26653613951e9b21ce915a92d205a87937f1
* API: Fix access on getExamplesMessagesBrad Jorsch2014-10-291-1/+1
| | | | | | | ApiBase declares it protected, but for some reason I had made it public in all subclasses. Change-Id: I8a50d4f47e66c7f09137968d3941dc5cdc1d28e4
* API: Internationalize all remaining core API modulesBrad Jorsch2014-10-201-14/+5
| | | | | | | | | This also adds some new ApiBase::PARAM_* constants to generate more helpful help, and a method to override the default description message for the use of ApiDisabled and ApiQueryDisabled. Bug: 71638 Change-Id: Ic0c3d232e0498d58a043037e2e0c6f0b1c3edad3
* API: Overhaul token handlingBrad Jorsch2014-08-261-11/+2
| | | | | | | | | | | | | | | | | | | | The current token handling is a mess. This simplifies things greatly: * *All* tokens are obtained from action=query&meta=tokens, rather than being spread over action=tokens, action=query&prop=info, action=query&prop=revisions, action=query&prop=recentchanges, and action=query&prop=users. All these old methods are deprecated. * Similarly, there is only one hook to register new token types. All old hooks are deprecated. * All tokens are cacheable. * Most token types are dropped in favor of a 'csrf' token. They already were returning the same token anyway. * All token-using modules will document the required token type in a standard manner in action=help and are documented in machine-readable fashion in action=paraminfo. Note this will require updates to all extensions using tokens. Change-Id: I2793a3f2dd64a4bebb0b4d065e09af1e9f63fb89
* API: Remove action=paraminfo 'props' and 'errors' result propertiesBrad Jorsch2014-08-071-25/+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-1/+1
| | | | Change-Id: Icae68c1ab1fd0006e00a3a9a56ae8f831d3d0d45
* Update formatting on API classes, Part 3Siebrand Mazeland2013-11-141-1/+2
| | | | Change-Id: I526be68e21836201c992b391a81f4d41e1fa801e
* Allow patrolling pages by revision idMarius Hoch2013-06-101-9/+37
| | | | | | | | | This became necessary as it's quite hard to get the rc id of a change from the html after I1e24733c. Bug: 49259 Change-Id: Ia7d3960cf11bf8ae0fc06ae1a0f7fcfb3c080f21
* 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 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 38190) Add "required" flag to some token paramsumherirrender2012-07-201-1/+4
| | | | | | action=block/action=unblock can not have the token required because when using the gettoken param, the token param can not set. Change-Id: I15317f16c06f150d29c1b17de76f41a6cfa84820
* Added result properties to action=paraminfoPetr Onderka2012-06-061-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Oh noes, moar http:// -> https://Sam Reed2011-11-281-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/104445
* Removed the 'eclipse helper' bit on top of every API moduleJohn Du Hart2011-11-161-4/+0
| | | | | | | | It's a parctice that dates back to 2006 when the API was first written, and frankly isn't covered by the coding conventions. Same thing with the docblocks, they're all copypasted with some bits changed and don't even make sense if you look at them in the genereated code docs. I don't feel that any of us depend on this anymore (get a better IDE), so in the inerest of consistancy it's time we said goodbye to it. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/103273
* Adding context to the APIJohn Du Hart2011-10-261-3/+1
| | | | | | | This will probably break something somewhere so when it does please yell at me on IRC and I'll fix it. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/100905
* Based on diff to wikia, set more functions consistently public rather than ↵Sam Reed2011-08-171-1/+1
| | | | | | | protected Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/94827
* Followup r92396Sam Reed2011-07-171-1/+1
| | | | | | | More modules documented, pretty much only action=query&list= to be done (ie links added where documentation pages exist already) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/92400
* Followup r92396, add help urls for most of the core (non query) modulesSam Reed2011-07-171-0/+4
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/92398
* Call doMarkPatrolled() on the RecentChange object instead of calling ↵Alexandre Emsenhuber2011-07-091-1/+3
| | | | | | | RecentChange::markPatrolled() that will create a second instance Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91800
* BREAKING CHANGE: Require POST for patrolling revisions and salt the patrol ↵Bryan Tong Minh2010-12-091-2/+5
| | | | | | | | | token with 'patrol' instead of rc_id. See my comments on r75274, for which this is a follow-up. Using a dedicated, but constant patrol token is in my opinion the optimal compromise between performance (only require fetching the token once) and security (leaking the token will only compromise the patrolling feature). Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/78141
* BREAKING CHANGE: Per r70640 CR, salt patrol tokens with rcid in the API too. ↵Roan Kattouw2010-10-231-1/+2
| | | | | | | This means patrol tokens are now different for every recentchanges entry. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/75274
* * (bug 25248) API: paraminfo errors with certain modulesSam Reed2010-10-011-0/+4
| | | | | | | Added a needsToken() function, rather than calling getTokenSalt, which can throw silly errors due to dependencies on parameters Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/74098
* Standardised file description headers, added @fileAlexandre Emsenhuber2010-08-071-3/+4
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/70647
* Followup r70461 if PARAM_REQUIRED is set, use for missing param in ↵Sam Reed2010-08-041-1/+0
| | | | | | | | | getPossibleErrors in ApiBase All but ApiQueryBacklinks Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/70474
* Followup to r70460 and r70461: Use true instead of 1X!2010-08-041-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/70462
* Followup to r70460: Committed wrong version of ApiBase.php, convert all core ↵X!2010-08-041-5/+2
| | | | | | | API modules to PARAM_REQUIRED syntax Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/70461
* Rewrote r69339 etc. to clean up API cache header handling.Tim Starling2010-07-231-2/+1
| | | | | | | | | | | | * Introduced a "cache mode" concept to simplify the header generation code, and to avoid odd results when conflicting cache header requests are received from submodules, or at least to formalise the handling of such cases. * Made the cache mode private by default, so that code written in ignorance of caching tends to be safe. If different query modules are used in a single request, private caching is preferred over public caching. * Removed the "must-revalidate" option from all CC headers, this is really specific to page views with a hacked squid in front, I don't think it's applicable here. * Made the watchlist module private. This is really the definition of private data. There's nothing in the HTTP spec that says the URL for a CC:public request is private and can't be leaked. CC:private provides protection against unknown proxy behaviour. * In ApiQueryAllmessages: avoid calling $wgLang->getCode() to check if it's necessary to make a new $wgLang when lang= is specified, since this is the only thing that unstubs $wgUser. * Removed "FIXME: should this check $user instead of $wgUser?" Answer is no. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/69776
* API: Make output containing private or user-specific data uncacheable for ↵Roan Kattouw2010-07-141-0/+1
| | | | | | | logged-in users by setting Vary: Cookie or Cache-Control: private, whichever is appropriate. Fixes instances in core and WMF-deployed extensions only. Without this change, the output of requests like ?action=query&list=recentchanges&rcprop=patrolled&smaxage=3600 would be cached in Squid and viewable for anyone using the same URL, even if they don't have patrol rights. Other, more serious exploits are also possible. Also avoid using $wgUser in one place, kill some unused global $wgUser; instances and tweak a comment. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/69339
* Correct the address of the FSF in some of the GPL headersDerk-Jan Hartman2010-06-211-1/+1
| | | | | | | 59 Temple Place -> 51 Franklin Street Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/68353
* Remove arrays from getDescription where we are only using 1 lineSam Reed2010-05-251-3/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/66893
* Mixture of things.Sam Reed2010-05-111-1/+1
| | | | | | | | | | | Couple of class comments Normalisation of "." usage at end of lines (removed) Normalisation of {prefix}parameter as per bug 23461 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/66232
* API: fix copyright symbol, coding style cleanup, more bracesJack Phoenix2010-02-231-17/+20
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/62883
* Followup to r62557 as per Roans commentSam Reed2010-02-161-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/62599
* Refactor requiresToken to getTokenSalt - Returns salt if exists, null if no ↵Sam Reed2010-02-151-6/+2
| | | | | | | | | | | | | salt, else false if no token required Move sessionfailure (token validation checking) up a couple of levels Part of bug 21991 Followup to r62482 and r62504 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/62557
* Start of "Bug 21991 - Move common query parameter (uc, rc) validation, ↵Sam Reed2010-02-141-3/+4
| | | | | | | | | | | | | token requiringness/checking to ApiBase/Similar" Move token requringness check to the ApiMain Adding an exception if we're using "gettoken" (block/unblock) Remove array( 'missingparam', 'token' ), from the getPossibleErrors of modules that set requireToken method to true Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/62482
* Rest of dieUsageMsg in getPossibleErrorsSam Reed2010-02-131-1/+10
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/62404
* stylize.php on API codeAryeh Gregor2010-01-111-19/+19
| | | | | | | | | | | | "I wouldn't object to stylizing the API code to bring it in line with the rest of MW on principle, but I'm not gonna bother myself." --Roan <http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60657#c5108> If you're seeing this commit in blames, tell your blame tool to ignore whitespace, e.g., git blame -w or svn blame -x -w. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/60930
* Kill a bunch of unused $wgUserChad Horohoe2009-04-281-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/49993
* * API: (bug 17832) action=delete returns 'unknownerror' instead of ↵Roan Kattouw2009-03-071-1/+1
| | | | | | | | | 'permissiondenied' when the current user is blocked * Fix this by changing all calls to current() to reset() Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/48122
* Fix typo.Rotem Liss2009-03-061-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/48092
* * API: (bug 17774) API pretends action=query doesn't exist for users without ↵Roan Kattouw2009-03-061-1/+4
| | | | | | | | | | | | read rights * Instead of hiding read-restricted modules, throw an error when a user without read rights tries to use them * Do the same for write modules when $wgEnableWriteAPI is false * Indicate whether a module needs read or write rights in action=help and action=paraminfo * BREAKING CHANGE: action=purge now requires write rights and, for anonymous users, a POST request Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/48091
* API: Some cleanupRoan Kattouw2009-02-271-1/+1
| | | | | | | | | * Aggressively intval() numeric things; addresses the concerns raised on bug 11633 * Use ApiQueryBase::addTitleInfo() everywhere * Remove a drug-induced-looking line from ApiQueryWatchlist.php Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/47865