Commit graph

213 commits

Author SHA1 Message Date
X!
a1422fa2be Add format=dump and format=dumpfm, outputs results in PHP's var_dump() format. Finding the type of a variable is a little annoying with txt, and dbg is a little bit harder to parse. 2010-08-09 00:19:55 +00:00
Alexandre Emsenhuber
457eb73b61 Standardised file description headers, added @file 2010-08-07 19:59:42 +00:00
Tim Starling
48862f74d2 Fix for r69776: remove unused variable ApiMain::$mVaryCookie 2010-07-26 07:35:30 +00:00
Sam Reed
5387b8a806 Stylize API up to date
Fix spaces from r69755

Minor update to RELEASE-NOTES per r69753
2010-07-23 07:33:40 +00:00
Tim Starling
b2dc451c82 Rewrote r69339 etc. to clean up API cache header handling.
* 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.
2010-07-23 07:17:56 +00:00
Sam Reed
46394d4551 Remove some unused globals 2010-07-22 22:00:27 +00:00
Sam Reed
2630065a22 Fix fail from r69755, press save, actually do "LIMIT_SML2, LIMIT_BIG2 are in ApiBase, not ApiMain" 2010-07-22 21:54:19 +00:00
Roan Kattouw
f0c87dbd00 Reverse-merge r69521 from 1.16wmf4: fix OpenSearch caching 2010-07-19 08:19:54 +00:00
Mark A. Hershberger
99e3ca5376 re r69339 use the actual function: s/hasCache/haveCache/ 2010-07-15 01:15:55 +00:00
Roan Kattouw
70824ccccc API: Make output containing private or user-specific data uncacheable for 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. 2010-07-14 19:00:54 +00:00
Bryan Tong Minh
8fc06f1725 Follow-up r69231: servedby is a boolean so will always be non-null. 2010-07-10 10:47:52 +00:00
Chad Horohoe
18d8635d00 (bug 24303) Expose hostname in API results. Show via servedby parameter, added unconditionally on errors 2010-07-10 10:37:39 +00:00
Bryan Tong Minh
55c96b6ca3 Revert r64436, r64437, r64508 per CR r64436 2010-07-09 09:46:05 +00:00
Max Semenik
4da25f6614 requestWriteMode() is deprecated and unused 2010-07-08 19:30:21 +00:00
Derk-Jan Hartman
921619b119 Correct the address of the FSF in some of the GPL headers
59 Temple Place -> 51 Franklin Street
2010-06-21 13:13:32 +00:00
Roan Kattouw
2c14858bb8 Fixed for r58099 per CR:
* Only clicktrack local, domain-relative URLs
* Validate redirect URL in ApiClickTracking with the same condition used in ClickTracking.js (local, domain-relative)
* Remove call to nonexistent function OutputPage::enable()
* Add functionality for disabling API output and use this after setting up the redirect. This fixes the issue where the body of the redirect contained an API response in xmlfm form
at; the body is now empty.
2010-06-03 09:53:28 +00:00
Sam Reed
7162b329b6 Add extra newline between permissions (nicer formatting) 2010-05-16 20:00:25 +00:00
Sam Reed
68ff239ac4 Minor part of bug 23473 - For the top level ApiMain/ApiQuery modules, note that module help is available before
Minor comment tweak to ApiQueryIWLinks
2010-05-15 11:07:31 +00:00
Sam Reed
e55ed729c4 Mixture of things.
Couple of class comments

Normalisation of "." usage at end of lines (removed)

Normalisation of {prefix}parameter as per bug 23461
2010-05-11 22:30:18 +00:00
Sam Reed
ff442ae79f * (bug 19721) API action=help should have a way to just list for a specific module 2010-05-08 11:45:41 +00:00
Sam Reed
0769301e87 Stylize Api upto date 2010-04-17 20:58:04 +00:00
Alexandre Emsenhuber
15dd2a1c40 Fix param names mismatch in code/doc from r64852 and r64397 2010-04-11 19:10:15 +00:00
Sam Reed
358b8344d1 Add link to Api Announcements mailing list 2010-04-09 18:24:32 +00:00
Matthew Britton
f83fb12d1d (bug 22339) "Go" result should be available through the API 2010-03-31 14:08:55 +00:00
Alexandre Emsenhuber
6777ee052d And while I'm at it, fix PHP Notice: Undefined variable: params in /www/w/includes/api/ApiMain.php on line 511 2010-03-30 18:55:48 +00:00
Alexandre Emsenhuber
480de64bff Fix parse error: syntax error, unexpected '}' in includes/api/ApiMain.php on line 467 2010-03-30 18:40:23 +00:00
Mark A. Hershberger
545fdc8c8f Refactor ApiMain to make the code more readable. 2010-03-30 17:14:53 +00:00
Jack Phoenix
c286869e38 API: fix copyright symbol, coding style cleanup, more braces 2010-02-23 18:05:46 +00:00
Mark A. Hershberger
ad75e1411c ws-only cleanup 2010-02-22 03:34:56 +00:00
Sam Reed
72582d7f4c r65299 c5894 followup
Move isset check of gettoken upto level of $salt !== false. If gettoken is set, the module isn't going to do anything else (and therefore no point seeing if there is a token set, let alone attempting to validate it)
2010-02-19 19:44:28 +00:00
Sam Reed
59e656c23b Stylize on Api
Manual layout improvements in ApiFeedWatchlist
2010-02-19 01:25:57 +00:00
Sam Reed
878c7da630 Followup to r62557 as per Roans comment 2010-02-16 21:59:16 +00:00
Sam Reed
64f884d74f Decomment parts accidentally commited commented in r62557 2010-02-16 01:29:58 +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
Roan Kattouw
d555e90cea Fix broken comma logic in r62486 2010-02-15 21:34:31 +00:00
Roan Kattouw
f02557a424 API: Redo r62540 for all modules, easier than I first imagined 2010-02-15 20:42:43 +00:00
Raimond Spekking
b1aba70d75 Fix fir r62482: PHP Notice: Undefined index: token in /www/w/includes/api/ApiMain.php on line 415 2010-02-15 09:22:11 +00:00
Tim Starling
278a489ffe Search suggestion API requests make up a substantial portion of our total apache load and thus deserve some optimisation:
* Made the cache expiry time configurable via $wgSearchSuggestCacheExpiry
* Removed must-revalidate from the Cache-Control of such requests. Introduced a generic interface to ApiMain for doing that.
2010-02-14 23:52:45 +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
40dd0530f9 Stylize API files 2010-02-13 01:41:37 +00:00
Sam Reed
6911358977 Complete dieUsage errors in 6 more Api files 2010-02-13 01:05:14 +00:00
Sam Reed
d2d950d256 Start of blanket coverage of dieUsageMsg in getPossibleErrors
Only basic ones done.

Couple of other modules done manually
2010-02-13 00:09:05 +00:00
Sam Reed
fe722d85a5 Move mustBePosted error into messageMap
Switch call to dieUsage to dieUsageMsg
2010-02-11 21:51:15 +00:00
Sam Reed
cf8d7ff1eb Add myself to Api Credits 2010-01-31 23:28:33 +00:00
Sam Reed
b15f2c8c46 Normalise comment usage (# --> //) 2010-01-23 22:52:40 +00:00
Mark A. Hershberger
b15cccb688 ws only cleanup 2010-01-22 03:14:52 +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
Tim Starling
12b8a2a75e Restored the function of ApiMain::requestWriteMode(), as per the suggestion on CR r50833. 2009-12-11 06:49:48 +00:00
Tim Starling
bd8fffe24d Reverted r58646 as per my comments on bug 20554. 2009-12-01 01:55:04 +00:00