Commit graph

124 commits

Author SHA1 Message Date
umherirrender
2fbf8e57b7 Fix hash validation in api
That must be a exact 31 characters, not 31 characters at once in a
longer string

Remove upper characters, because database contains only lower characters
and there is no strtolower

Change-Id: Ic980fd719955842fad30a315eedd71381caf8aa5
2012-11-18 18:37:55 +00:00
Aaron Schulz
e6faa2fd76 Merge "escape HTML elements in docblock with double quotes" 2012-07-18 19:17:46 +00:00
Antoine Musso
4f5d2386f3 escape HTML elements in docblock with double quotes
Doxygen choke on text enclosed by '<' and '>' since it tries to
interpret them as HTML or XML elements. This patch adds double quotes
in includes/api/*.php files around the two following strings:

 <Firstname>.<Lastname>@gmail.com
 <Firstname><Lastname>@gmail.com

Which becomes:

 "<Firstname>.<Lastname>@gmail.com"
 "<Firstname><Lastname>@gmail.com"

Tested locally, it prevents doxygen 1.8.0 related warnings.

Change-Id: I36d82eb3fd4989ee3ffc65b0b527b83711d1ba69
2012-07-15 22:15:45 +02:00
Reedy
002d871048 Api method documentation tweaks
Change-Id: I43398b6016f64accf86921c72a6dac5e71e11c34
2012-07-12 16:53:00 +01:00
umherirrender
426ccbf42e (bug 19195) Make user IDs more readily available with the API
Add some block ids and user ids to the result of some modules

Change-Id: If50604b888a54827eddde76574e779db6c7263ec
2012-04-22 14:20:46 +02:00
Reedy
f8d2958da9 Can't return values from functions that don't return anything
Change-Id: If964ce2f39904f1e9e3101e7cafaa6a96d58adfc
2012-04-19 14:07:40 +01:00
Sam Reed
e1d83d5721 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:54 +00:00
Aaron Schulz
5a6559d8b1 Reverted r108743 per CR comment. This should at least be discussed first. 2012-01-12 19:41:18 +00:00
Sam Reed
a5c200a25b Kill "* @return void" 2012-01-12 19:12:24 +00:00
Brion Vibber
e5e8ec7b62 Provisional revert of r105831: as noted it's not safe; alternative fix was a weird abstraction violation that would leave you not knowing whether the data would be present or not. 2011-12-20 21:37:04 +00:00
Brion Vibber
20e322abf5 Revert r106523: abstraction violation, looks very wrong, unclear benefits 2011-12-20 21:20:50 +00:00
Sam Reed
997fb135cd Per bug 28901, and Duplicatebug on r105831, only list the Article ID if it has already been loaded
Not a long term fix, but saves potentially a lot of database queries to lookup article ids, until the other issues on bug 28901 are tidied up
2011-12-17 19:55:49 +00:00
Sam Reed
76762a26b9 Make ApiQueryBase::addTitleInfo() add the pageid also 2011-12-11 21:07:39 +00:00
Sam Reed
d1e77338a6 * (bug 32495) API should allow purge by pageids.
ApiPageSet isn't really designed for non query usage, but a little hacking and it can be made to work in the ApiPageSet mould. Allows us to use titles, pageids and revids, without the work of validating them and such ourselves

Same caveat that you can't use a mix of them in one request - tough!
2011-12-11 20:43:42 +00:00
John Du Hart
2e7d867478 Removed the 'eclipse helper' bit on top of every API module
It's a parctice that dates back to 2006 when the API was first written, and frankly isn't covered by the coding conventions. Same thing with the docblocks, they're all copypasted with some bits changed and don't even make sense if you look at them in the genereated code docs.
I don't feel that any of us depend on this anymore (get a better IDE), so in the inerest of consistancy it's time we said goodbye to it.
2011-11-16 00:17:26 +00:00
Roan Kattouw
2563e19c39 (bug 26909) Add dir parameter for prop= API modules. Modified patch by Umherirrender 2011-11-14 08:19:55 +00:00
Sam Reed
1ba364df99 Update documentation
Fix some context method calls which were considered deprecated
2011-10-28 18:10:41 +00:00
John Du Hart
40f19e6def Adding context to the API
This will probably break something somewhere so when it does please yell at me on IRC and I'll fix it.
2011-10-26 23:27:01 +00:00
Bryan Tong Minh
2d21957eef Follow-up r84765, use timestampOrNull 2011-10-07 19:11:08 +00:00
Bryan Tong Minh
c18151c38c (bug 29392) Setting the start or end parameter now works with lists blocks, categorymembers, deletedrevs, logevents, protectedtitles, usercontributions and watchlist in Postgres.
Since all those used ApiQueryBase::addWhereRange, added ApiQueryBase::addTimestampWhereRange, which does automagic timestamp conversion. Not tested whether this actually fixes problems in Postgres, but at least the API modules are still functional in SQLite
2011-10-06 20:46:24 +00:00
Sam Reed
25ea9b8d95 Replace more multiple calls to $this->getResult() in methods with temporary variable 2011-06-30 01:06:17 +00:00
Sam Reed
79d982679f Followup r89576, and other related revisions
Move SHA1 has validation functions in ApiQueryBase
2011-06-25 03:50:41 +00:00
Sam Reed
d3cd73cc25 Documentation updates and additions 2011-06-05 21:04:48 +00:00
Sam Reed
289af6c964 Add some documentation
Swap if ( $foo ) { $this->addFields( 'foo' ); } for $this->addFieldsIf( 'foo', $foo ); etc

Also swap $this->addFieldsIf( 'foo', $foo ); $this->addFieldsIf( 'foo2', $foo ); for $this->addFieldsIf( array( 'foo', 'foo2' ), $foo );


Micro-optimisation and readability!
2011-06-01 16:40:59 +00:00
Sam Reed
2730c42dd8 Whitespace fixes
Addition/tweak of documentation
2011-05-08 21:47:01 +00:00
Sam Reed
ab28af877c Followup r85884
Fixup the APIs strange way of doing table aliases on a join....

Only used in very few places
2011-04-30 23:18:34 +00:00
Sam Reed
cf023d04dc As I've removed most of Roans reason to use php magic variables, completely remove them this time.
Followup r84430
2011-03-20 22:46:09 +00:00
Sam Reed
24d0b16dc9 Followup r84392
Be a bit more explicit about the code, add a bit of readability into foreach too
2011-03-20 22:35:41 +00:00
Roan Kattouw
a6c758a39a Per r83812 CR, solve the categorymembers paging problem by doing separate queries for each value of cl_type, with some trickery to make paging work. This makes the enum->varchar schema change for cl_type unnecessary, so I'll revert that.
Code was largely copied from Tim's CR comment on r83812 but adapted to deal with the fact that we have to apply the cmcontinue-induced WHERE on cl_sortkey and cl_from only for the first query. Because ApiQueryBase doesn't let us unset or overwrite conditions like these in a nice way, I added an $extraQuery parameter to ApiQueryBase::select() that excepts additional query parameters that are only applied to that query but not stored in the object.
2011-03-20 16:25:01 +00:00
Sam Reed
e357db3122 * (bug 27670) Ordering by timestamp (and usage of start and end) isn't as clear in auto generated document, as it is on mw.org
Followup r83797, closing. Adding bit of documentation, + RELEASE-NOTES
2011-03-13 00:07:22 +00:00
Sam Reed
8c6f2012b9 * (bug 27670) Ordering by timestamp (and usage of start and end) isn't as clear in auto generated document, as it is on mw.org
where dir = (newer|older)

Will look at doing (asc|desc)(ending)?
2011-03-12 23:39:15 +00:00
Sam Reed
20548c2596 Fix r83390, need to do where ipb_deleted IS NULL as we're left joining in the table, so it can be null
Duh
2011-03-07 22:58:26 +00:00
Sam Reed
aea7a5a482 Followup r83390
If the user is allowed to view hidden users, put a missing property on all users.

For list=users, do the same, but we can't easily distinguish to other people the difference between "hidden", or "missing", so no reason to do it
2011-03-06 20:51:31 +00:00
Sam Reed
5ad9f48ef8 Fix where ipb_deleted from r83390 2011-03-06 20:38:00 +00:00
Sam Reed
c488abeeb8 * (bug 27897) list=allusers and list=users list hidden users
Refactored addition of block information, and also checked if user is allowed to view hidden user fields
2011-03-06 17:59:08 +00:00
Sam Reed
573abcbd8c Refactor out the duplication I left with a TODO in r79659 2011-02-27 21:31:47 +00:00
Sam Reed
6309c920dd Delete all the "API for MediaWiki 1.8+" comments
Add since to ApiQueryQueryPage
2010-12-22 20:52:06 +00:00
Sam Reed
25637962d5 What's a boolif? 2010-09-25 16:38:44 +00:00
Matthew Britton
bb3897976d follow up r72387: using ApiQuery here breaks ApiParamInfo (bug 25248) 2010-09-23 10:46:08 +00:00
Platonides
925c6d0c36 Make happy check-vars. This shows it that getQuery() returns an ApiQuery (more specifically, that getQuery() doesn't return an article) 2010-09-04 18:31:37 +00:00
Alexandre Emsenhuber
457eb73b61 Standardised file description headers, added @file 2010-08-07 19:59:42 +00:00
Roan Kattouw
075c8d1624 Followup to r69776: cache result of extractRequestParams() because it gets called 2 or 3 times per module per request now. Also touch up documentation here and there 2010-07-23 10:15:29 +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
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
Alexandre Emsenhuber
750a03860f Fixed some doxygen warnings 2010-03-08 21:11:32 +00:00
Alexandre Emsenhuber
00ed478a33 Fixed some doxygen warnings 2010-03-07 17:26:23 +00:00
Jack Phoenix
96b4f302af API: fix copyright symbol, coding style cleanup, more braces 2010-02-24 13:34:11 +00:00
Sam Reed
9e44e9295d Fixup spaces to tabs from r62404 2010-02-14 14:29:24 +00:00
Sam Reed
2081a0693f Rest of dieUsageMsg in getPossibleErrors 2010-02-13 00:28:27 +00:00