Commit graph

69 commits

Author SHA1 Message Date
Sam Reed
789cc18185 Followup r64197
Return null in getWatchlistValue if no change

Fixup unneccessary watch/unwatch calls

Remove useless unwatch from ApiUpload
2010-03-28 15:08:45 +00:00
Sam Reed
88df448d36 Fix bug 22944 in a much better fashion (using watchlist parameter)
Deprecate old watch/unwatch parameters

Move generic watchlist stuff to ApiBase/getWatchlistValue (maybe needs renaming better?)

Tweak some braces in ApiEditPage
2010-03-25 22:15:08 +00:00
Jack Phoenix
c6f2480903 ApiEditPage.php: fix copyright symbol, spacing and coding style cleanup, more braces 2010-02-22 12:18:42 +00:00
Sam Reed
41ba6ce60f Minor fixup to api/ApiEditPage.php to remove getMaxArticleSize function 2010-02-16 22:01:38 +00:00
Sam Reed
878c7da630 Followup to r62557 as per Roans comment 2010-02-16 21:59:16 +00:00
Sam Reed
7478ad3576 Remove a couple of duplicated errors from ApiEditPage getPossibleErrors
Unindent one level in ApiMain substituteResultWithError
2010-02-15 23:56:09 +00:00
Sam Reed
0e8b0b41ac Refactor requiresToken to getTokenSalt - Returns salt if exists, null if no 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
2010-02-15 23:53:43 +00:00
Sam Reed
80f9448690 Start of "Bug 21991 - Move common query parameter (uc, rc) validation, 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
2010-02-14 22:20:27 +00:00
Sam Reed
9e44e9295d Fixup spaces to tabs from r62404 2010-02-14 14:29:24 +00:00
Sam Reed
6852091907 Fix fail in ApiEditPage.php 2010-02-13 01:24:00 +00:00
Sam Reed
6911358977 Complete dieUsage errors in 6 more Api files 2010-02-13 01:05:14 +00:00
Sam Reed
2081a0693f Rest of dieUsageMsg in getPossibleErrors 2010-02-13 00:28:27 +00:00
Sam Reed
b15f2c8c46 Normalise comment usage (# --> //) 2010-01-23 22:52:40 +00:00
Sam Reed
47c24175d3 Add/remove whitelines to increase readability in API code files 2010-01-23 22:26:40 +00:00
Sam Reed
9513f0bc3f (bug 22225) - misspelt wpEdittoken -> wpEditToken in ApiEditPage
Patch By Matthew Britton
2010-01-22 10:48:57 +00:00
Aryeh Gregor
3758769f0d stylize.php on API code
"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.
2010-01-11 15:55:52 +00:00
Roan Kattouw
f9d79167d3 API: (bug 20967) action=edit allows creation of invalid titles that look like interwiki titles. Patch by Sam Reed 2009-11-06 14:44:04 +00:00
Bryan Tong Minh
be1cd24b80 Throw a bit more helpful unknownerror at AS_END, indicating that AS_END was encountered. This actually needs fixing higher up, but this at least clarifies for now what kind of unknownerror occurred. 2009-10-28 13:35:39 +00:00
Chad Horohoe
c660ee428f (bug 21106) tag deprecated parameter in action=paraminfo. Add new PARAM_DEPRECATED const for automagically tagging deprecated parameters. Keeps action=help and action=paraminfo up to date 2009-10-28 00:56:07 +00:00
Roan Kattouw
0a7ce36121 API: (bug 20816) Editing a page with &watchlist=preferences (default) unwatches it if you're watching it but don't have watching preferences set. This is a regression from r53266 2009-09-26 09:22:44 +00:00
Brion Vibber
aa1740d88d Cleaning up some old PHP 4 object-reference usage in some edit filtering hooks.
There was a mix of uses of the reference and non-uses of the reference. :)
Reverts r53714 and fixes it from the other end by cleaning up the uses to not expect references.
2009-08-21 21:51:29 +00:00
Bryan Tong Minh
f5137ba626 (bug 19090) Added watchlist parameter, deprecated watch and unwatch parameter in action=edit 2009-07-14 20:48:00 +00:00
Bryan Tong Minh
d8aa4337f9 (bug 19040) Fix prependtext and appendtext in combination with section parameter in action=edit 2009-07-14 20:14:47 +00:00
Bryan Tong Minh
31d9947618 (bug 18533) Add readonly reason to readonly exception 2009-07-12 12:38:03 +00:00
Roan Kattouw
ea5b014e38 Followup to r50132: I guess I was smoking some pretty good stuff there 2009-05-02 15:03:02 +00:00
Roan Kattouw
5924eb85f0 API: Set $wgTitle to a dummy title in api.php, and introduce defined('API') as a check for API mode. This should fix errors about $wgTitle being null 2009-05-02 14:47:26 +00:00
Roan Kattouw
674724e686 API: (bug 18546) Added timestamp of new revision to action=edit output 2009-04-21 14:49:13 +00:00
Roan Kattouw
ac81ec6513 API: (bug 18099) Editing a non-existent page with appendtext caused the contents of the noarticletext(anon) message to appear in the page text 2009-03-24 16:15:43 +00:00
Roan Kattouw
21fd7af97e * API: (bug 17774) API pretends action=query doesn't exist for users without 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
2009-03-06 13:49:44 +00:00
Roan Kattouw
88f35cdf6e API: Some cleanup
* Aggressively intval() numeric things; addresses the concerns raised on bug 11633
* Use ApiQueryBase::addTitleInfo() everywhere
* Remove a drug-induced-looking line from ApiQueryWatchlist.php
2009-02-27 16:03:01 +00:00
Roan Kattouw
6449867508 * API: (bug 15949) Add undo functionality to action=edit
* Move undo text generation from EditPage::getContent() to Article::getUndoText()
* Add some more examples for action=edit
* ApiEditPage.php: don't mix !is_null() and isset(), be consistent
2009-01-26 13:51:03 +00:00
Roan Kattouw
7c6e96a734 API: (bug 16581) Fix regression from r44015 ("Various minor cleanup") which changed Article::replaceSection() to treat $section=null as $section=0 rather than $section='' as it did before, causing a nasty API edit bug. When changing a function's behavior, please update the callers, and don't forget the API. 2008-12-10 14:12:54 +00:00
Tim Starling
f48c6070df Removed all instances of empty() where error suppression was not intended. Replaced with conversion to boolean, count() or empty string check as appropriate. Fixes a number of bugs due to incorrect conversion to boolean: suppressed edit summaries containing '0', ignored titles called '0', searches for '0' ignored, etc. 2008-10-25 14:04:43 +00:00
Roan Kattouw
5896f16a44 (bug 15647) API edit with basetimestamp fails if the page has been deleted and undeleted since the last edit 2008-10-04 13:43:17 +00:00
Rotem Liss
8b54f0f2b5 Fixing a function call. 2008-09-30 16:08:39 +00:00
Chad Horohoe
acf01dd7b8 Added setVal accessor to $wgRequest->data so we don't have to access it directly. Use this in ApiEditPage. 2008-09-30 15:13:13 +00:00
Roan Kattouw
b294f9a437 (bug 15473) Correcting Doxygen comment for ApiEditPage 2008-09-04 13:40:33 +00:00
Roan Kattouw
6cba51e734 (bug 15444) API: Throwing a regular 'unknownerror' rather than ('unknownerror', AS_END) when EditPage::AS_END is returned, for consistency with other write modules. 2008-09-03 14:26:41 +00:00
Roan Kattouw
db6744da16 API: Fixed bug that caused all action=edit requests to return with the nochange flag set on wikis where DB_MASTER != DB_SLAVE 2008-08-26 20:49:52 +00:00
Roan Kattouw
1d3b95ab8d API: Throwing a more specific error message when the client tries to create empty new sections, which isn't allowed. Unknown error: ``228'' isn't very user-friendly. 2008-08-26 20:40:44 +00:00
Roan Kattouw
042a034033 API: Add nocreate parameter to action=edit 2008-06-15 20:37:28 +00:00
Roan Kattouw
fd91970655 API: action=edit: Make the combination of prepend/appendtext and md5 do something useful. See also mailing list 2008-06-15 19:59:55 +00:00
Roan Kattouw
8b86f3bc01 (bug 14459) Added prependtext and appendtext parameters to action=edit 2008-06-12 13:05:07 +00:00
Bryan Tong Minh
fb30149415 Remove the AlternateEdit hook from the API: it is a hook meant to show a different EditForm which is not what we want to do. 2008-05-31 14:07:15 +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
aac9e5198e APIEditPage:
* Moving $wgRequest faking down to below the APIEditBeforeSave hook call
* Faking wpCaptcha{Id,Word} in $wgRequest for ConfirmEdit (should also be done better)

Hopefully we'll be able to ditch this crappy EditPage::attemptInternalSave() interface shortly
2008-05-28 09:14:35 +00:00
Bryan Tong Minh
e3275354a0 * Add wfRunHook calls where appropriate
* Fix handling of file redirects in ApiDelete
* Throw an error when a file is undeleted as this is not supported
2008-05-24 20:44:49 +00:00
Leon Weber
bef3c3b755 2008-05-23 22:02:23 +00:00
Roan Kattouw
ea12f3bcaa (bug 14231) Tweak help for action=edit 2008-05-22 21:33:25 +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