Commit graph

205 commits

Author SHA1 Message Date
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
Roan Kattouw
1b89cd274a API: (bug 20554) Expose average slave lag (avglag) as well as maxlag. Patch by Sam Reed. 2009-11-06 14:38:55 +00:00
Roan Kattouw
ef4886778f API: Per CR comments on r56091, make the timeout for the API help cache configurable 2009-09-17 19:39:34 +00:00
Roan Kattouw
87d401f2e6 Fix r56091: cache URLs with and without ?version separately 2009-09-17 15:47:44 +00:00
Roan Kattouw
29c594f9a4 Follow-up to r55639: per CR comment, make API help caching disableable, and let the cache key depend on the version string 2009-09-09 12:54:56 +00:00
Roan Kattouw
d7f593a312 API: Add user-agent and method (GET/POST) to request logging, and only log the action= parameter for mustBePosted modules 2009-08-27 22:09:28 +00:00
Roan Kattouw
adf309bdc8 API: Cache API help in memcached, inital use of the API log added earlier seems to indicate that the help is expensive. Cache doesn't seem to help for me locally, so we probably need to test this on a real server and see if it really works. 2009-08-27 18:25:51 +00:00
Roan Kattouw
0070e5c6e2 Revert r52190 ("Return HTTP 503 on API maxlag error"): announcement prompted many complaints, and the change never went live. 2009-07-16 08:04:15 +00:00
Michael Dale
aefc40d749 here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview

= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions

== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php

* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)

== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.

= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader

* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html  )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.

= js2 system  / mwEmbed=
$wgEnableJS2system = false

* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)

* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.

= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs  <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)

== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.

== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00