aboutsummaryrefslogtreecommitdiffstats
path: root/api.php
Commit message (Collapse)AuthorAgeFilesLines
...
* echo is not a functionumherirrender2013-05-091-2/+2
| | | | | | Removed parenthesis after echo Change-Id: Ia533aedf63b11d15dcc6a5cf75a56134a4b11d86
* Remove hphpc support and deprecate related functionsTim Starling2013-05-091-5/+1
| | | | | | | | | | | | | | | | | hphpc has been superseded by hhvm, so support for hphpc is no longer needed. * Continue to use Preprocessor_Hash under HipHop since it is still faster under hhvm * Keep $wgCompiledFiles for now, so that wikihiero doesn't give an error before Ic9d1e795 is merged * Migrate the run-server script and associated configuration file to hhvm. Enable EnableStaticContentFromDisk since it doesn't seem ridiculously inefficient at first glance. Run from $IP rather than $IP/.. since hhvm is apparently not picky about sourcing files from outside of the current directory. Change-Id: Ic3e769f1fbad4f7ad26dd819406796fee48c6b45
* Lots of spelling mistakes and phpdoc attributesYuri Astrakhan2013-03-101-1/+1
| | | | | | | | | | @throw->@throws @returns->@return @seealso->@see @cover->@covers etc Change-Id: I9ae6bc3034e9790e2d66cd96473b923fe9ee7953
* Update code formattingSiebrand Mazeland2013-02-141-5/+5
| | | | Change-Id: I8741b5b979e55f38a666961a16c387586a92410e
* style: normalize end of filesAntoine Musso2013-02-031-1/+0
| | | | | | | | | | | | By PSR2 PHP Standard, the files should ends with exactly one newline. Some of our files have 2 or more and some other were missing a newline. Fix almost all occurences of CodeSniffer sniff: PSR2.Files.EndFileNewline.TooMany I have not fixed the selenium files, I believe we will drop them. Change-Id: I89fca8c1786fee94855b7b77bb0f364001ee84b6
* (bug 36537) Rename calls to wfArrayToCGI to wfArrayToCgiAlex Monk2013-01-281-1/+1
| | | | | | | Done with this command: grep wfArrayToCGI * -R -l -Z | xargs -0 -l sed -i -e 's/wfArrayToCGI/wfArrayToCgi/g' && git checkout -- HISTORY Change-Id: If7f4d4bfc199289c11c43cf519c2415a1aad1c51
* Follow up to dirname( __FILE__ ) clean upHoo man2012-08-281-0/+1
| | | | | | | | Remove a trailing whitespace added by me in dirname( __FILE__ ) clean up and add some comments to the PHP version checks (they can't use __DIR__ as they have to run in older PHP versions. Change-Id: I6a7e8cb7dbf384d91dda4d0ecbef7ce588bc3073
* Use __DIR__ instead of dirname( __FILE__ )jeroendedauw2012-08-271-1/+1
| | | | | | We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :) Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
* Pass the full context to the ApiMain instance from api.php.Alexandre Emsenhuber2012-07-061-1/+1
| | | | | | | Passing only the WebRequest instance is not the best thing when it accepts a complete context. Change-Id: If02148c850b395a2382f87cbeafbc25887ce8728
* Reimplement CORS properly, addressing Tim's concernsCatrope2012-07-051-37/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tim's concerns (listed at https://bugzilla.wikimedia.org/show_bug.cgi?id=20814#c6) were: * Lack of Vary: Origin breaks Squid caching * Vary: Origin on everything would be disastrous, so add an origin param * Origin header is space-separated list, wasn't treated as such This commit: * Remove CORS code from api.php and reimplement it in ApiMain.php * Add 'origin' parameter to ApiMain * If 'origin' parameter doesn't match Origin header, send a 403 * If origin is whitelisted, set CORS headers and set Vary: Origin * Add https?:// to wildcard matching logic, wasn't there but is needed CORS now works :) you can test it locally as follows: Set $wgCrossSiteAJAXdomains[] = '*.wikipedia.org'; Log into MediaWiki on localhost Go to Wikipedia, open a JS console, and run: $.ajax( { 'url': 'http://localhost/w/api.php', 'data': { 'action': 'query', 'meta': 'userinfo', 'format': 'json', 'origin': 'https://en.wikipedia.org' // or whichever domain you're on; must be correct! }, 'xhrFields': { 'withCredentials': true }, 'success': function( data ) { alert( 'Foreign user ' + data.query.userinfo.name + ' (ID ' + data.query.userinfo.id + ')' ); } } ); Change-Id: I725ce176866d7c81dd9ad6d7bc4a86b7160f2458
* Added missing GPLv2 headers in some places.Alexandre Emsenhuber2012-05-231-14/+10
| | | | | | Also made file documentation more consistent. Change-Id: I30e124514396f110a572467b94ca06cefd5f7b46
* Various updates needed to bump min php version to 5.3.2Reedy2012-04-161-1/+1
| | | | Change-Id: I22015387e4ac5839a907059086d787f352746886
* API: trunk/phase3 is now mediawiki/corePlatonides2012-03-231-1/+1
| | | | | | e7544995a090f98fd4d803686d90087e9273bb41 follow-up. Change-Id: Ic0c82e0a54cefded24fc3aa260ddc051e30e8ab5
* Update some deprecated codeSam Reed2011-10-141-1/+1
| | | | | | | | | | | Documentation Fix "/*" comments to "/**" Flesh out some missing returns, change some return types Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/99808
* Revert r96715 per committer's (Chad's) CR commentRoan Kattouw2011-09-141-3/+0
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/97057
* Fix documentation, document return typeSam Reed2011-09-131-2/+4
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/96959
* Add a comment about something I noticed while spelunking the codeChad Horohoe2011-09-101-0/+3
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/96715
* Moved wfGetIP() to WebRequest::getIP():Alexandre Emsenhuber2011-08-181-1/+1
| | | | | | | | | * Changed all calls in core to the latter * Also marked wfGetForwardedFor() as deprecated * Moved wfGetIP() tests to WebRequestTest Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/94932
* Clean up the mess that is wfDie (resolves r85918). wfDie() doesn't exist ↵Chad Horohoe2011-07-061-14/+8
| | | | | | | | | anymore, so don't use it. The only two usages left since r91590 are php version checks for index/load/api.php, and $wgAPIEnabled check in api.php. Consolidate all of the "bailing for invalid version" into PHPVersionError.php. Leaving $wgAPIEnabled as the only user was silly, so just echo and die like wfDie() would've done Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91602
* (bug 28840) If the query string hits bug 28235, redirect to a safer URL ↵Tim Starling2011-06-031-12/+1
| | | | | | | instead of showing an unhelpful error message. IE 6 will only use the extension of the final destination for its cache filename. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89397
* HipHop improvements:Tim Starling2011-05-301-1/+5
| | | | | | | | | | | | | | | | | * Added the ability to compile extensions. The build process is bootstrapped by running MediaWiki in interpreted mode. Extension setup file inclusions are slightly modified in a way that makes them register themselves for compilation. Then the same LocalSettings.php uses the compiled extension setup file when the compiled binary runs. * Tested with Cite and ParserFunctions. The code which lets you have an extensions directory in a place other than $IP/../extensions is untested. * Simplified WebStart.php slightly by using a custom $_SERVER variable to mark compiled mode. It will break if you don't use the supplied server.conf, but that will break a lot of things so don't do that. * Fixed the core web entry points to include WebStart.php in compiled mode instead of interpreted. * Made the build directory configurable. This is mostly so that I can grep the source tree without seeing loads of generated C++. * In server.conf, added a rewrite rule allowing a /wiki/$1 article path. * Removed server.conf log file location "/dev/stdout", breaks when you switch user * Disable static content cache, breaks horribly when you set SourceRoot to a directory containing 7GB of files. * Rewrote the run-server script in PHP, mostly to support the configurable build directory feature. * Added an option to the run-server script to allow running in interpreted (hphpi) mode. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89166
* Revert r87635, r87637, r87639, r87643 (MW_MIN_PHP_VERSION etc.): breaks ↵Tim Starling2011-05-151-7/+3
| | | | | | | HipHop support. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88176
* Centralise the minimum-required-php-version in a MW_MIN_PHP_VERSION constant ↵Happy-melon2011-05-071-3/+7
| | | | | | | | | in Defines.php. This requires loading Defines.php before the PHP4 version checks, so include a big note reminding people not to include anything other than vanilla define() statements in there. I have a sneaking suspicion that including Defines.php in the entry points might not play nicely with HipHop, but I can't test it (wrong OS). Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/87637
* Improvements to handling of 'catastrophic' errors, like unsupported PHP ↵Happy-melon2011-04-121-7/+23
| | | | | | | | | | | | | | versions, no MySQL functions, no LocalSettings, etc. * Fix parsing of the three major entry points (index.php, api.php, load.php) back to PHP 4.4.9. We don't care what happens if you actually try to run these files on old versions, but the entry files need to parse correctly. * consign /includes/templates/PHP4.php and /includes/templates/NoLocalSettings.php to the fiery pit of hell where they belong. * Prevent loading of any other files for PHP < 5. WebStart.php was rendered unparseable in PHP 4 by the introduction of try/catch blocks in r85327. * Die outright with a pretty error message on PHP < 5.2.3 as well as PHP 4. All versions of PHP below that throw parse errors of various sorts. * Reimplement wfDie() to provide an entry-point-dependent die-with-readable-error-message function (for instance, we want a pretty human-readable page in index.php, something wrapped in CSS/JS /*...*/ comment block in load.php, etc). * Standardise the appearance of the catastrophic errors thrown at the top of the stack with the ones lower down (exception-within-exception, etc). There isn't really a way to do this without duplication, AFAICT. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/85918
* Fix for bug 28235: IE6 looks for the file extension in the query stringTim Starling2011-04-121-2/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/85844
* (bug 16019) Make WebRequest::interpolateTitle() do nothing when run from api.phpIlmari Karonen2010-12-101-3/+3
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/78209
* 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
* API performance fixes: avoid unstubbing $wgContLang and $wgUserRoan Kattouw2010-02-151-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/62545
* various eol whitespace now instead of when someone needs to do CRMark A. Hershberger2010-02-121-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/62354
* stylize.php on API codeAryeh Gregor2010-01-111-11/+11
| | | | | | | | | | | | "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
* API: Add user-agent and method (GET/POST) to request logging, and only log ↵Roan Kattouw2009-08-271-3/+10
| | | | | | | the action= parameter for mustBePosted modules Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/55643
* API: Add optional API request logging to a file or UDP; intending to use ↵Roan Kattouw2009-08-271-0/+13
| | | | | | | this on the cluster to get some data about API usage and things like which queries are expensive Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/55632
* Tweak Access-Control-Allow-Origin stuff per comments on r54127.Alex Z2009-08-211-13/+29
| | | | | | | Use a wildcard syntax rather than string/regex options Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/55400
* * Fixed XSS vulnerability introduced by r49833. Only pre-release versions of ↵Tim Starling2009-08-171-9/+3
| | | | | | | | | | | | MediaWiki were affected. * Refactored the IE script entry point security check into WebRequest::isPathInfoBad(). Use the standard CGI variable PATH_INFO to do this check instead of the various potential non-standard solutions. Made the check fairly permissive to avoid a repeat of bug 13049 due to broken CGI setups especially with cgi.fix_pathinfo=0. This should theoretically be very portable and secure, but I have not tested it widely. * Removed Chris Wrinn from the credits since his patch was wrong and has been removed. * Made the error message more informative. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/55178
* (bug 19907) Adds support for cross-domain AJAX requests to the API.Alex Z2009-07-311-0/+19
| | | | | | | | | | | Uses the Access-Control-Allow-Origin header for browsers that support it. <http://dev.w3.org/2006/waf/access-control/> $wgCrossSiteAJAXdomains can be set to '*' to allow requests from any domain, an array of domains to allow, or, if $wgCrossSiteAJAXdomainsRegex is true, an array of regexes to match against the request origin Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/54127
* Followup to r50132: rename API define constant to MW_API, per comment on CRRoan Kattouw2009-05-051-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/50218
* Followup to r50132: I guess I was smoking some pretty good stuff thereRoan Kattouw2009-05-021-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/50134
* API: Set $wgTitle to a dummy title in api.php, and introduce defined('API') ↵Roan Kattouw2009-05-021-0/+7
| | | | | | | as a check for API mode. This should fix errors about $wgTitle being null Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/50132
* API: (bug 13049) This'll hopefully fix the 403 Forbidden error in api.php ↵Roan Kattouw2009-04-241-3/+3
| | | | | | | for the setups that were getting them (most notably FastCGI and IIS). Patch by Chris Wrinn Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/49833
* Same as r48631; added "@file" when needed, also added doc in redirect.php ↵Alexandre Emsenhuber2009-03-211-20/+22
| | | | | | | and install-utils.inc Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/48658
* -1 is not a valid exit codeTim Starling2008-11-141-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/43474
* * Fix unlogged automatic user creation: run wfLBFactory()->shutdown() ↵Tim Starling2008-05-171-0/+3
| | | | | | | | | unconditionally in api.php. If you want to optimise it, do it in the database backend, since there's no way for the MW core to indicate to the web API that a write query has been performed. The previous code was also wrong in that it didn't commit transactions on foreign connections. * Fixed debugging code left in (mustBePosted disabled). Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/34951
* This is cleaner, thanks to ialexRoan Kattouw2008-04-021-3/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/32725
* (bug 13587) Execute deferred updates in api.phpRoan Kattouw2008-04-021-0/+5
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/32717
* * Security fix for API on MSIEBrion Vibber2008-01-231-0/+23
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/30087
* API:Yuri Astrakhan2007-07-301-1/+1
| | | | | | | | | | * Added full text search in titles and content (list=search) * (bug 10684) Expanded list=allusers functionality * Possible breaking change: prop=revisions no longer includes pageid for rvprop=ids * Bug fix: proper search escaping for SQL LIKE queries. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/24453
* Remove ?>'s from files. They're pointless, and just asking for people to ↵Aryeh Gregor2007-06-291-1/+1
| | | | | | | 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.) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/23531
* API: applied the patch by amidaniel to allow the same limits for sysops as ↵Yuri Astrakhan2007-05-221-2/+19
| | | | | | | for bots. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/22315
* API: documentation and cleanup.Yuri Astrakhan2007-05-201-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/22289
* * API: Restructured to allow internal usage. Error handling cleanup.Yuri Astrakhan2006-10-141-68/+1
| | | | | | | * API: Added opensearch module, added apprefix param for list=allpages Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/17005