Commit graph

141 commits

Author SHA1 Message Date
Roan Kattouw
042a034033 API: Add nocreate parameter to action=edit 2008-06-15 20:37:28 +00:00
Roan Kattouw
8b86f3bc01 (bug 14459) Added prependtext and appendtext parameters to action=edit 2008-06-12 13:05:07 +00:00
Roan Kattouw
cf5484e56f API: Added optional md5 parameter to action=edit. If set, the edit will only be committed if the MD5 hash of the text parameter equals the md5 parameter. 2008-05-28 09:22:40 +00:00
Roan Kattouw
d478350295 * Refactor Title::isValidMoveOperation() and Title::moveTo() to return an array of arrays like Title::getUserPermissionsErrors() does; other functions used by the write API have undergone similar refactoring earlier
* Handle these return values in MovePageForm::doSubmit() and ApiMove::execute()
* Remove separate AbortMove hook calls from MovePageForm and ApiMove; these were used to capture the hook error, but the new return type handles that. Also, it resulted in two calls to that hook for each move
* Remove comment about SpecialMovepageAfterMove hook from ApiMove::execute(): we don't need it, there's the TitleMoveComplete hook for that. SpecialMovepageAfterMove is a UI hook that doesn't belong in the API
* Add imagenocrossnamespace and imagetypemismatch errors to ApiBase::$messageMap
2008-05-27 14:42:51 +00:00
Roan Kattouw
000f346c1b Handle multiple warnings correctly in ApiBase::setWarning(). Calling this function twice from the same module used to throw a fatal error. 2008-05-20 19:43:50 +00:00
Roan Kattouw
119ca6e2ed API: Unrecognized values for multivalue parameters now don't cause the API to abort with an error anymore, but just throw a warning and are ignored. This is useful for ??prop parameters, but also applies to other multivalue parameters such as list, meta and prop. Single values still throw an error like they used to. 2008-05-20 19:31:45 +00:00
Alexandre Emsenhuber
087a9f70c5 WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>

Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage

One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
Victor Vasiliev
8f98402e51 * (bug 13965) Hardcoded 51 limit on titles is too limiting 2008-05-06 05:12:47 +00:00
Aaron Schulz
b76e7e0db0 Put some upper limit here 2008-05-03 04:17:03 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00
Bryan Tong Minh
06d1b8087d (bug 11673) Return error 'unknown_action' in specified format 2008-04-05 19:32:21 +00:00
Roan Kattouw
07c2553b86 API: Forgot a whole bunch of messages specific to ApiEditPage 2008-03-30 18:59:27 +00:00
Roan Kattouw
b15f80ba74 Remove stray backslash 2008-03-28 16:17:04 +00:00
Roan Kattouw
6090218f2a API: Rename dontcreate to createonly, which actually makes sense 2008-03-25 21:12:01 +00:00
Roan Kattouw
e0a6679e8c Fixing E_NOTICE 2008-03-25 21:01:30 +00:00
Roan Kattouw
6afa8f9d63 API: Adding dontcreate parameter to action=edit 2008-03-25 20:41:55 +00:00
Roan Kattouw
53b7bdb63f API: Added help text message that specifies whether a module is POST-only 2008-03-25 15:47:23 +00:00
Alexandre Emsenhuber
2ed1bedb94 * Fixed call to deprecated functions
* Remove unused global declaration of $wgArticle in SkinTemplate::buildNavUrls()
2008-03-24 15:04:55 +00:00
Aaron Schulz
7389d07057 $value should come in as a string (if it doesn't, trim() will cast it to one anyway). Once trimmed, a truly empty list should be "" not "0". This fixes the massive namespace param breakage. 2008-03-21 06:28:02 +00:00
Victor Vasiliev
3cb5a4f858 Handle empty sets correctly 2008-03-20 16:28:38 +00:00
Roan Kattouw
69653bd247 API: Fixing limit=max output; previous implementation threw fatal errors under certain conditions and didn't accomodate for some modules having different limits in some cases. 2008-02-25 14:12:55 +00:00
Roan Kattouw
3f48af6d30 Fixing some messages in ApiBase 2008-01-25 12:52:14 +00:00
Roan Kattouw
491cc4a320 API: Making a bunch of state-changing modules require POST requests. 2008-01-18 20:43:59 +00:00
Roan Kattouw
0ffedad161 * Changing PageArchive::undelete() and undeleteRevisions() to return false rather than an error code
* Refactoring ApiUndelete to use ApiBase::dieUsageMsg()
* Adding new messages to ApiBase::$messageMap
2008-01-18 19:38:28 +00:00
Roan Kattouw
152463e335 * Refactored IPUnblockForm::doUnblock() to return an array of message keys and parameters
* Refactored IPUnblockForm::doSubmit() and ApiUnblock accordingly
* Added even more messages to ApiBase::$messageMap
2008-01-18 18:53:57 +00:00
Roan Kattouw
61a205a3c9 * Refactoring IPBlockForm::doBlock() to return message keys
* Refactoring ApiBlock accordingly
* Adding check for blockemail right to ApiBlock
* Adding more messages to ApiBase::$messageMap
* Fixing E_NOTICE in SpecialIpblocklist.php
2008-01-18 17:48:03 +00:00
Roan Kattouw
d371af72a8 API:
* Refactored ApiProtect. No need for core modifications this time :)
* Added permissions check to ApiMove to protect against messages with arguments getting none. moveTo()'s return value should really be modified, see also comment
2008-01-18 16:34:40 +00:00
Roan Kattouw
1b2b5ecde0 API: Unifying "the ... parameter must be set" messages into one ('missingparam'), expanding $1 in error codes as well. 2008-01-18 16:01:31 +00:00
Roan Kattouw
1f4ddb930d Core:
* Using getUserPermissionsErrors() rather than userCan() in Title::isValidMoveOperation()
* Removing blocked check from Article::doRollback(): Title::getUserPermissionsErrors() checks for that already

API:
* Refactoring ApiMove to use new messages system
* Adding more messages to ApiBase::$messageMap
* Removing unused parameter to 'notanarticle' in ApiDelete::execute()
2008-01-18 15:52:40 +00:00
Roan Kattouw
70b5fdd2c9 API:
* Refactored ApiDelete to use the new dieUsageMsg() system
* Adding some more messages to ApiBase::$messageMap
* Also using dieUsageMsg() for API-related errors in ApiRollback
* Removing 'lo' prefix for ApiLogout as it doesn't have any parameters anyway
2008-01-18 14:34:14 +00:00
Roan Kattouw
01a2386468 API:
* Introducing ApiBase::dieUsageMsg() function which outputs the error associated with a certain message key
* Updating rollback module to use dieUsageMsg(). Other modules will follow.
2008-01-15 20:21:16 +00:00
Daniel Cannon
5b6dd97612 API: Various docu and clean-up. 2008-01-12 07:08:17 +00:00
Rotem Liss
9d02a8c560 Quick solution for problems with limit=max when using slow queries: allowing modules to delay the parsing of limit=max until they get the actual maximum values, and making them parse it by themselves. 2008-01-05 10:05:34 +00:00
Victor Vasiliev
3a24c169ea API:
* Hide edit modules from help if $wgEnableWriteAPI is disabled
* Fix help formatting on UsageException
2007-12-02 15:04:53 +00:00
Victor Vasiliev
197ebe413c * Add limit=max to API. It also adds limit info to output 2007-11-29 15:19:56 +00:00
Roan Kattouw
073bc45c2b Adding apihighlimits permission. Users with this permission can request 10 times as many rows in API requests. Enabled by default for sysops and bots. 2007-11-29 14:51:58 +00:00
Roan Kattouw
4895ce631f Revert part of Brion's 27627: please don't throw away the child (maxlag) with the bathwater (format=raw) 2007-11-19 15:57:58 +00:00
Brion Vibber
b61adceeb9 Revert r27581, 27598, 27626
format=raw is an HTML injection machine like action=raw but without any safeguards; it's trivial to create JavaScript exploits which hit at least Internet Explorer.
There's no reason to add a whole new danger point here when you've got machine-readable structure already... please do not add this raw formatter back.
2007-11-19 15:32:06 +00:00
Victor Vasiliev
d7908b82e0 * Use ApiBase::dieDebug() to render maxlag error properly
* Allow modules to ignore maxlag attribute
2007-11-19 15:08:18 +00:00
Victor Vasiliev
60fc9cb245 API:
* Add format=raw
* Added raw output support to ApiExpandTemplates and ApiRender
2007-11-17 16:45:59 +00:00
Nick Jenkins
8d8b106dc2 Variable $user seemed to be used before it was defined - removing. 2007-08-20 08:04:12 +00:00
Yuri Astrakhan
380f66878f API: Removed maximum limit checking when running api in an internal mode. 2007-07-15 00:52:35 +00:00
Yuri Astrakhan
f5aa2e8018 API: implemented prop=imageinfo, minor cleanup 2007-07-07 03:05:09 +00:00
Yuri Astrakhan
fb4a5e0a4f API: Backlink-style queries (backlinks, imageusage, embeddedin) now use ??title parameter instead of titles (support for titles will be discontinued later). 2007-07-06 07:16:38 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +00:00
Yuri Astrakhan
583ac87532 API: Fixed error codes encoding per bug 10308. 2007-06-25 05:44:33 +00:00
Yuri Astrakhan
d656615e9f API: applied the patch by amidaniel to allow the same limits for sysops as for bots. 2007-05-22 04:39:49 +00:00
Yuri Astrakhan
b4de075600 API:
revisions - removed oldid (not used except in content retrieval), added extra prop options to optimize bandwidth, continue value is now an integer in JSON
 minor help screen improvement.
2007-05-21 06:32:32 +00:00
Yuri Astrakhan
cb38c11c84 API: documentation and cleanup. 2007-05-20 23:31:44 +00:00
Yuri Astrakhan
ef219bae7b API:
breaking change: Query watchlist shows flags only when explicitly requested with wlparam=flags, and rc_this_oldid (textid) is no longer accessible
query watchlist cleanup
bug in the integer parameter min/max validation
bug in feed formatting in error handling
some documentation
2007-05-20 10:08:40 +00:00
Yuri Astrakhan
ff52013a33 API: fixed Bug 9969: SQL error when an improper title is given to API
a bit better debugging facilities
2007-05-19 22:56:42 +00:00
Yuri Astrakhan
db6b9f7206 updated with the last api changes 2007-05-19 20:37:06 +00:00
Yuri Astrakhan
fea6038271 * API: Watchlist feed allows 'hours' parameter of how many hours to go back 2007-05-19 18:08:36 +00:00
Yuri Astrakhan
0f69063f40 API: minor code cleanup. Bug that exposed secure wiki pages should be fixed. 2007-05-19 06:42:08 +00:00
Yuri Astrakhan
15419ad729 API: resolved bug 8772: Parameter to limit results to revisions made by a particular user, when querying revisions for a page
(patch by Carl Fürstenberg)
2007-05-19 04:13:48 +00:00
Yuri Astrakhan
0e68016b72 * New properties: links, templates, images, langlinks
* Breaking Change: imagelinks renamed into imageusage (il->iu)
* Bug fix: incorrect generator behavior in some cases
2007-05-14 05:28:06 +00:00
Nick Jenkins
f9619da3f0 Yet more doc tweaks:
* Add @addtogroup tags to various classes, to try and group conceptually-related classes together.
* Add brief descriptions to various Special pages, thanks to Phil Boswell.
* Moving some docs to be right above the classes they represent, so that they are picked up.
2007-04-20 08:55:14 +00:00
Nick Jenkins
113bb1c772 Documentation tweaks to help documentation systems (Doxygen + PHPDocumentor)
pick up the appropriate tags, and documentation blobs for classes. This is 
the same as per r20769, but with the grouping changes (e.g. removing "@{{") omitted.
Please be advised that more related documentation tweaks may follow later - e.g. 
Doxygen generates a log file of warnings that is 574 Kb in size, when run over 
the just the trunk/phase3 code ... eek! Thankfully, much of that is just 
whining about functions without documentation   ;-)
2007-04-04 05:22:37 +00:00
Brion Vibber
3a6ac5a3c3 Revert r20769: we don't use PHPDocumentor anymore, we use doxygen.
If making mass changes to tweak to its preferences, probably better to do it for the tool we actually generate docs with. :)
2007-03-28 14:16:43 +00:00
Nick Jenkins
5fef2333d4 PHPDocumentor [http://en.wikipedia.org/wiki/PhpDocumentor] documentation tweaking stuff.
Minor doc tweaks to prevent some PHPDocumentor warnings or errors when run on the includes/ directory. PHPDocumentor uses a syntax very similar to javadoc - mostly we already use this, but there were a few scattered places that were adjusted to make them consistent with the rest of the code. In practical terms, these changes were made:
* @url becomes @link
* @fixme becomes @todo
* HTML tags in descriptions must be closed / balanced.
* @bug was removed (where the bug was long fixed), or changed into a @todo (in the few situations where the bug was still pending)
* @obsolete becomes @deprecated
* Things like "/**@{{" and "/**@}}*/" which cause "unknown tag" warnings were removed
* @access must be a valid access level.
* @desc tag not needed, removed.
* Doesn't seem to like @licence, will accept @license however.
* Use full comment block notation in a few places (i.e. open block with "/**", start each line with " *", and end block with " */")

Then additional to this, to get some class docs associated with their respective classes:
* Moved some docs to right above those classes (deleting blank lines, or moving descriptions from the file headers)
* Marked some classes without docs as "@todo document"
* (done up to "class MIMEsearchPage" on the "classtrees_MediaWiki.html" page for the includes/ directory)
2007-03-28 08:53:02 +00:00
Nick Jenkins
14c53b728f Code housekeeping stuff (and barring any stuff-ups on my behalf, there should be no changes in behaviour whatsoever after this) -
* removing some unused global declarations.
* removing or commenting out or adding comments for unused local vars.
* Adding one or two local var declarations.
* Declaring $matches array passed to preg_match() / preg_match_all() as array() before using [not required, just have a slight preference for the explicitness].
* remove one or two pass-by-reference function declarations where the value is not modified.
* Adding some braces to if-else blocks.
* In Parser.php, stripstrate is now an object rather than an array as per r17820, so we no longer need ask for a reference to it (as in "$x =& $this->mStripState;"), and in fact it's probably just simpler to get rid of $x altogether.
* Moving some preg regexes from "" quoting to '' quoting to stop static analyzer whinging about bad escape sequences.

... up to "LinksUpdate.php" in the includes/ directory.
2006-11-23 08:25:56 +00:00
Yuri Astrakhan
b900efa97f API * version param now links to the SVN
* debug case fixes 
* renamed ApiQueryContributions to ApiQueryUserContributions (a bit clearer)
2006-11-04 05:24:59 +00:00
Yuri Astrakhan
ed43f714f4 API * better self-description for various modules
* namespace type for parameters
* fixed bug with incorrect ordering in paging
* fixed bug with revisions and watchlist paging
2006-11-03 06:53:47 +00:00
Yuri Astrakhan
751f69aa94 API * Implemented backlinks / imagelinks / embeddedin modules
* Revised help screen
2006-10-30 00:18:05 +00:00
Yuri Astrakhan
815e545e4b API * Extra profiling for allpages * better help output 2006-10-22 19:52:22 +00:00
Yuri Astrakhan
88e42b579b API * Common field output function to simplify result generation
* Recent changes parameters
2006-10-21 08:26:32 +00:00
Nick Jenkins
33b7c11ded * Don't give attackers an opening by echoing back known bad parameter inputs.
* Create magic links only using a whitelist of protocols.

Have no proof of vuln, but allowing the user to make JavaScript links and have a lot of control over what goes into them probably isn't desirable.
Example attack input:
  http://en.wikipedia.org/w/api.php?action=query&meta=javascript://**/alert(1);

Example pre-patch HTML output contains this string:
  <a href="javascript://**/alert">javascript://**/alert</a>(1);
Which doesn't work, due to:
 1) the double slash - one slash someone can work around by faking a C-style comment (by appending "**/" as shown above), but two is a problem
 2) the parentheses being excluded, so we can't pass parameters
... but best to put a stop to it anyway.
2006-10-19 08:18:19 +00:00
Yuri Astrakhan
550c083a18 API
* Removed slow result SanitizeData
* Fixed watchlist feed bug (reported by nickj)
* Fixed HTML formatting bug (reported & fixed by nickj)
* clarified HTML intro message
2006-10-18 05:27:43 +00:00
Nick Jenkins
88879743df * Probably want "$this->mIsGenerator = false;", not "$mIsGenerator = false;"
* rm unused global declaration.
* rm references usage in a foreach iteration ($info does not seem to be assigned to anything, so no benefit to using refs).
* Define local var in error printout.
* rm a few local vars that look unused.
* Make paranoia check do something.
2006-10-17 09:27:39 +00:00
Yuri Astrakhan
f928f9a6cd API * Better log events info * Added RAW debugging format 2006-10-17 02:01:20 +00:00
Yuri Astrakhan
39fda46535 API * better profiler modules naming 2006-10-16 23:25:51 +00:00
Yuri Astrakhan
519252da6e API * Enabled global profiling 2006-10-16 23:16:12 +00:00
Yuri Astrakhan
262435b9f8 * API: help screen now shows default and allowed parameter values
* API: added experimental watchlist rss/atom feed
* API: if available, json_encode() will be used
* API: opensearch parameter changed to "search=" (more descriptive)
* API: minor parameter cleanup, a wrapper for Feed class
2006-10-16 00:08:03 +00:00
Yuri Astrakhan
7a710254db * API query optimizations
* API allow modules to have custom printers
2006-10-15 07:43:52 +00:00
Yuri Astrakhan
b56d23ed46 * API: Restructured to allow internal usage. Error handling cleanup.
* API: Added opensearch module, added apprefix param for list=allpages
2006-10-14 07:18:08 +00:00
Yuri Astrakhan
f229bdc8be * API: added watchlist module (incomplete)
* API: minor param cleanup
2006-10-13 06:13:13 +00:00
Yuri Astrakhan
31775400d8 *API: rewired generator (more work needed)
*API: structure cleanup: module names & parameters
2006-10-03 05:41:55 +00:00
Yuri Astrakhan
4ade08ef76 * API: implemented generator function
* API: enabled allpages to function as a generator
2006-10-02 23:56:19 +00:00
Yuri Astrakhan
c01eb06e5e *API: better version gen, added check for read-only api, added allpages params description 2006-10-02 18:27:06 +00:00
Yuri Astrakhan
04399b2063 * API: added version information to each module (available via api.php?version command) 2006-10-01 21:20:55 +00:00
Yuri Astrakhan
e859600cea * API: pageSet now supports pageids, revised revisions listings, lots of examples. 2006-10-01 20:17:16 +00:00
Yuri Astrakhan
85de1cb74b * Code cleanup per TimStarling's suggestions 2006-10-01 04:38:31 +00:00
Yuri Astrakhan
f97b323e00 * API: result data generation cleanup, minor cleaning 2006-10-01 02:02:13 +00:00
Yuri Astrakhan
8deda5c25a * API: revisions & pageset cleanup 2006-09-30 08:06:27 +00:00
Yuri Astrakhan
5c1ca0fc83 * API: Refactored per brion's suggestions
* API: began query revisions implementation (incomplete)
2006-09-27 05:13:48 +00:00
Yuri Astrakhan
8a7397e8ad * API: Overall query-related cleanup. 2006-09-26 06:37:26 +00:00
Yuri Astrakhan
972b72f879 * API: All pages list
* API: Reworked parameter processing
2006-09-26 05:43:02 +00:00
Yuri Astrakhan
e57335a633 * API: Query Meta SiteInfo module
* API: Improved query help screen
2006-09-26 01:44:13 +00:00
Yuri Astrakhan
fcfcf6fdf9 * API-query: normalization
* API: help screen improvements
2006-09-23 23:30:25 +00:00
Yuri Astrakhan
1fc6e9cc86 * API: major refactoring
* API: added login functionality
* API: added several output formats (needs optimization)
2006-09-23 15:57:16 +00:00
Yuri Astrakhan
e7ad7f3d41 * Non-working API to facilitate dev collaboration. Do not enable this yet in localsettings.php. 2006-09-08 14:27:58 +00:00