Brion Vibber
5b8a7db0c4
Revert r45810 "API: (bug 17027) Allow all configuration variables in $wgAPIReadableConfigVars to be read through meta=siteinfo&siprop=configvars. I tried my best to only make useful stuff readable and skip stuff that's sensitive (like $wgDBpassword), available already (like $wgExtraNamespaces) or useless (like $wgUpdateRowsPerJob)."
...
This is way too tightly coupled to internal implementation details. Any and all of those things could change dramatically; they're not appropriate for an external API.
2009-01-20 22:57:05 +00:00
Roan Kattouw
9100cdcd03
API: (bug 17069) Added ucshow=patrolled|!patrolled to list=usercontribs
2009-01-19 16:04:33 +00:00
Roan Kattouw
0635eeb4c4
API: (bug 17048) Show the 'new' flag in list=usercontribs for the revision that created the page, even if it's not the top revision
2009-01-19 15:23:12 +00:00
Roan Kattouw
a7c7a3fd33
Revert r45821, r45830, r45831 and r45835 all in order to revert r45819, per discussions on CR. Will redo part of r45819 momentarily.
2009-01-19 13:56:08 +00:00
Roan Kattouw
75eaf96468
API: Fixing paging in list=alllinks, which seems to have been broken for a long time. Also fix alunique, which simply didn't work. No RELEASE-NOTES entry since I'm gonna backport this to 1.14.
2009-01-17 19:52:37 +00:00
Roan Kattouw
9b3dd5122a
Another followup to r45819: update references to the renamed archive.usertext_timestamp index. The user_newtalk.user_id and user_newtalk.user_ip indices aren't used anywhere that I could find.
2009-01-17 10:11:42 +00:00
Roan Kattouw
b8d66efbb1
Followup to r45810: remove unused global declaration
2009-01-16 21:10:02 +00:00
Roan Kattouw
d161831223
API: (bug 17027) Allow all configuration variables in $wgAPIReadableConfigVars to be read through meta=siteinfo&siprop=configvars. I tried my best to only make useful stuff readable and skip stuff that's sensitive (like $wgDBpassword), available already (like $wgExtraNamespaces) or useless (like $wgUpdateRowsPerJob).
2009-01-16 21:03:13 +00:00
Roan Kattouw
ecf739b57a
* svn:eol-style native for r45755
...
* Replace spaces with tabs in ApiFormatJson_json.php, fix some crazy indentation
2009-01-15 10:18:44 +00:00
X!
97da594444
(bug 17025) Add "fileextension" parameter to meta=siteinfo&siprop=
2009-01-14 22:15:50 +00:00
Roan Kattouw
5559e3f2b9
API: Clean up invalid UTF-8 in the result before feeding it to the formatter. This should fix bug 15261 (trimmed multibyte chars) and bug 16262 (chars like \x0f)
2009-01-14 21:22:00 +00:00
Roan Kattouw
d70050053a
API: (bug 16844) Added clcategories parameter to prop=category to make checking whether a certain page is in a certain category more efficient
2009-01-14 17:04:46 +00:00
X!
d9b9a30bb3
Fix comment leftover from ApiLogout
2009-01-14 00:00:40 +00:00
Roan Kattouw
fde54a8395
API: (bug 16858) Revamped list=deletedrevs to make listing deleted contributions and all deleted pages possible. This reintroduces drnamespace (removed earlier because of performance concerns, now implemented efficiently) and introduces druser, drexcludeuser, drfrom, drcontinue and drunique
2009-01-12 16:39:04 +00:00
Roan Kattouw
c0cd843e63
API: (bug 16629) "edit=:move=" in page.page_restrictions was interpreted incorrectly. Also moved up the code checking for legacy protections to right after the code checking for 'new' protections.
2009-01-12 14:27:28 +00:00
Roan Kattouw
4268665fc1
API: (bug 16798) Fix for PHP bug 46944 (PHP's JSON formatter encodes certain UTF8 characters incorrectly) by falling back to our own formatter if PHP's is broken. Also fix up our own JSON formatter which also messed up these characters, albeit in a different way. Slightly modified patch by Brad Jorsch.
2009-01-12 14:11:20 +00:00
Bryan Tong Minh
24a930a13e
Force the use of the PRIMARY key rather than the name_title in the second query.
2009-01-08 22:02:16 +00:00
Aryeh Gregor
7091024181
s/existant/existent/
2009-01-01 02:02:03 +00:00
Alex Z
93164e1dc8
fix param description, rollback token comes from prop=revisions
2008-12-26 04:13:47 +00:00
Roan Kattouw
781597bdce
API: Fix weird ==/=== bug in API help: a possible value of zero is interpreted as "can be empty".
2008-12-21 00:21:01 +00:00
Roan Kattouw
6ddef7e30a
API: (bug 16730) Added apprfiltercascade parameter to list=allpages to filter cascade-protected pages
2008-12-20 23:54:04 +00:00
Roan Kattouw
2584890446
Fix up r44860, use $wgContLang instead.
2008-12-20 23:49:16 +00:00
Roan Kattouw
25bf90b363
API: (bug 16726) siprop=namespacealiases should also list localized aliases
2008-12-20 23:20:15 +00:00
Roan Kattouw
0dfff7a988
API: Fixing issue mentioned on bug 16129 comment #3 : for certain inputs, action=parse dies with an internal error whining about $wgTitle not being set in OutputPage::parse(). This commit works around this by setting $wgTitle, but the parser and its friends should really leave $wgTitle alone, because people might want to parse non-$wgTitle titles, which the Parser::parse() docs suggest is possible (and it should be), but apparently isn't.
2008-12-20 20:00:07 +00:00
Roan Kattouw
cc98ce259b
API: Fix up r44676: convert underscores to spaces in canonical names.
2008-12-18 15:00:07 +00:00
Roan Kattouw
8504bf43e2
API: Crusade against extract(). Left one extract() call alone in ApiQueryBacklinks.php because I don't have a better alternative for it.
2008-12-17 16:34:01 +00:00
Roan Kattouw
06a5efe4fa
Revert r44716 (added user,excludeuser to watchlist,recentchanges): can't commit this just yet because not all WMF servers have the user_text index just yet, see also bug 14200
2008-12-17 15:35:57 +00:00
Roan Kattouw
91b4dfb130
API: (bug 16527) Added user and excludeuser parameters to list=watchlist,recentchanges
2008-12-17 14:50:48 +00:00
Brion Vibber
2f1cee5b91
Cleanup r44683 -- fix E_NOTICE bug in MWNamespace::getCanonicalName() instead of replicating the function. :)
...
(Also note -- using MWNamespace instead of Namespace for PHP 5.3 compat.)
2008-12-16 23:57:21 +00:00
Alex Z
ddde44606b
Fix for r44676, fix E_NOTICE from having no canonical name associated with a namespace (ns 0), move RELEASE-NOTES entry to API section and clarify.
2008-12-16 19:59:37 +00:00
X!
5bf752ee6a
* (bug 16672) Add canonical parameter to meta=siteinfo&siprop=namespaces|namespacealiases.
2008-12-16 17:19:05 +00:00
Chad Horohoe
a8a6844e61
Support extension information in meta=siteinfo.
2008-12-14 22:06:32 +00:00
Roan Kattouw
38de20ffeb
API: (bug 16647) list=allcategories, prop=categories don't return "hidden" property for hidden categories. Patch by Brad Jorsch
2008-12-14 20:24:23 +00:00
Chad Horohoe
be374a912a
War on wfElement() and friends. Call the Xml members directly, rather than using old wrappers.
2008-12-14 19:14:21 +00:00
Roan Kattouw
4142713195
Follow-up to r44584: finishing comment.
2008-12-14 17:44:13 +00:00
Roan Kattouw
1c9d353390
API: (bug 15579) clshow considers all categories !hidden. Modified patch by Brad Jorsch
2008-12-14 17:39:50 +00:00
Roan Kattouw
684a4c3fb7
API: (bug 16549) Kill a filesort in list=allpages&apfilterlanglinks=withlanglinks by replacing DISTINCT with GROUP BY. Of course GROUP BY page_namespace, page_title would suffice on MySQL, but Postgres will reportedly whine about that being against the SQL standard. Using GROUP BY on all selected fields instead (should please pgsql) and taking care that page_namespace, page_title is on front, which shouldn't cause a filesort is MySQL is smart enough (5.0 is, let's just hope 4.1 is too)
2008-12-14 17:04:24 +00:00
Roan Kattouw
65a7f19470
API: Fix broken block expiry calculation in list=recentchanges
2008-12-14 15:50:40 +00:00
Alex Z
abba40eaad
* (bug 16626) action=delete now correctly handles empty "reason" param
2008-12-13 21:07:18 +00:00
Roan Kattouw
8e9a43114a
API: (bug 16594) Use strict comparison in list=allusers. This'll hopefully make [[User:]] on enwiki show up again; he's currently being dropped from the user list because false == ''
2008-12-11 21:51:01 +00:00
Alexandre Emsenhuber
fc4b2f597e
Fix encoding
2008-12-11 19:11:11 +00:00
Roan Kattouw
ada841ab2d
* API: (bug 16613) action=protect doesn't say when &cascade is set but cascading protection wasn't allowed
...
* Changed Article::updateRestrictions()'s $cascade parameter to a reference which is set to false if cascading protection isn't allowed
* Used this in ApiProtect
* Expand help message for &cascade a bit
2008-12-10 22:39:41 +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
Alexandre Emsenhuber
b6f827b739
* fix doxygen warnings
...
* fix whitespaces
2008-12-08 17:29:24 +00:00
Roan Kattouw
8fc3724a4a
API: (bug 16541) Adding block expiry timestamp to list=logevents output (calculated from the block's timestamp and its duration)
2008-12-04 15:59:26 +00:00
Roan Kattouw
95c67c8df6
Revert part of r44232, accidentally committed too much
2008-12-04 15:55:47 +00:00
Roan Kattouw
7e35fc4b5a
API: (bug 16515) Added pst and onlypst parameters to action=parse, which do a pre-save transform on the input
2008-12-04 15:51:39 +00:00
Roan Kattouw
56d9fba12d
API: Recommit r44182 (Added usprop=canemail to list=users) and rename canemail to emailable
2008-12-04 14:42:30 +00:00
Brion Vibber
77f1ee20d2
Pull back r44182 for now "* API: (bug 16526) Added usprop=canemail to list=users, which tells whether a user can (and wants to be) e-mailed through [[Special:Emailuser]]."
...
"canemail" is ambiguously named, and on first blush indicates that the user "can email", which would mean that they can *send* email, which doesn't appear to be what it's used for.
2008-12-03 23:37:27 +00:00
Roan Kattouw
16755e7fd3
API: (bug 16548) list=search threw invalid errors under certain circumstances
2008-12-03 19:33:57 +00:00
Roan Kattouw
1040ce28e4
* API: (bug 16526) Added usprop=canemail to list=users, which tells whether a user can (and wants to be) e-mailed through [[Special:Emailuser]].
...
* Refactored some code to use a User object
2008-12-03 19:07:16 +00:00
Roan Kattouw
d522ff9263
API: (bug 16516) Made rvsection=T-2 work rather than being interpreted as rvsection=0
2008-12-03 19:01:30 +00:00
Ilmari Karonen
34fb6297cd
Step 2 in NS_IMAGE -> NS_FILE transition (bug 44) (WARNING: huge commit).
...
This is a global search and replace of NS_IMAGE and NS_IMAGE_TALK with NS_FILE and NS_FILE_TALK respectively in all core files, excluding those already updated in step 1 (r44004).
2008-12-01 17:14:30 +00:00
Bryan Tong Minh
0e5ad9bbde
Allow easier debugging of this module by distinguishing between the two queries
2008-11-28 11:36:04 +00:00
Roan Kattouw
70e0646bf0
API: (bug 16421) Actually do user name normalization in list=logevents. Also fix up User::idFromName so it doesn't think "Talk:Catrope" isn't the same user as "Catrope"
2008-11-22 15:46:36 +00:00
Roan Kattouw
c8acd86afc
API: (bug 16408) Added DOM tree generation (rvgeneratexml) to prop=revisions. Looks kind of ugly in XML, but bots don't care about that, and people should use less crappy-looking formats anyway.
2008-11-21 13:55:27 +00:00
Roan Kattouw
a6e101025d
Fix up r43673: reindex the rights array after removing duplicates
2008-11-20 15:15:00 +00:00
Roan Kattouw
c3be8a3034
API: (bug 16398) meta=userinfo&uiprop=rights lists a right twice if it's granted to two groups the user is in
2008-11-20 14:46:10 +00:00
Roan Kattouw
7aff9997f2
API: (bug 12760) meta=userinfo&uiprop=ratelimits doesn't list group-specific rate limits
2008-11-18 16:05:24 +00:00
Roan Kattouw
e250759491
API: Make reblocking (introduced in r42843) possible through the API
...
* Add reblock parameter to action=block
* Tweak the description for allowusertalk for consistency
2008-11-18 15:21:04 +00:00
Roan Kattouw
a7223d80bc
API: (bug 16367) Add allowusertalk attribute to list=blocks output
2008-11-18 15:11:11 +00:00
Brion Vibber
4c54e4016f
* API siteinfo query no longer throws an exception for empty sifilter parameter.
...
The parameter is defined as being one of two values ('local' or '!local'), but comes back as array() if it was specified but empty... which then got overly-strictly checked against 'false', which was used internally for the case where it's unspecified, and an exception thrown internally.
Now the filter parameter is nicely ignored whether it's unspecified or specified as empty, which is good clear behavior.
As before, other values return a standard API error about invalid values being passed.
2008-11-17 18:13:11 +00:00
Brion Vibber
18d5de14ba
$oldName parameter to UserLogoutComplete hook call was missing.
...
Caused this warning (harmless in practice):
PHP Warning: Missing argument 3 for CentralAuthHooks::onUserLogoutComplete() in /usr/local/apache/common-local/php-1.5/extensions/CentralAuth/CentralAuthHooks.php on line 217
2008-11-15 01:23:39 +00:00
Tim Starling
4daa2dbb6a
Don't use getParameter() inside substituteResultWithError(), since it will try to call dieUsage() again if the format parameter is invalid. This fixes the error message for invalid formats, which was broken.
2008-11-14 00:30:34 +00:00
Siebrand Mazeland
c426e6b9d7
Consistent casing for wfGetDB(), getDB(), and getDBKey()
2008-11-06 22:38:42 +00:00
Siebrand Mazeland
9bc9c1d161
Consistent casing for wfGetDB()
2008-11-06 22:30:55 +00:00
Roan Kattouw
d5a1e9cf4b
API: (bug 16225) apfrom=Talk:Foo behaved like apfrom=Foo because Talk: was interpreted as a namespace prefix. This caused bugs when trying to query-continue with a title like Talk:Talk:Foo. Other XXfrom and XXprefix parameters probably had this bug as well.
2008-11-03 10:13:00 +00:00
Aaron Schulz
3337669b0c
* Fix comment
...
* Rename HexToIP -> HexToQuad
2008-11-02 18:35:58 +00:00
Roan Kattouw
db6d1ed1dc
API: Move ApiQueryBlocks::convertHexIP() to IP::hexToIP() per Werdna's comment on r43040
2008-11-02 16:50:59 +00:00
Roan Kattouw
0ea1d6ea9c
API: Followup on r43014: clean up some more
2008-11-01 22:19:39 +00:00
Roan Kattouw
36174d19cb
API: Clean up ApiQueryBlocks, which was a stylistic mess. I can't believe I actually wrote that code (I was young and foolish, I guess :P )
2008-11-01 19:23:14 +00:00
Alex Z
1b580a65d2
(bug 16207) - Fix title protection in the API. $expiry is cast to an array near the start and doesn't have the correct timestamp format here anyway.
2008-11-01 00:00:25 +00:00
Roan Kattouw
ec6060e5c9
API: Fix r42813, committed some stuff that shouldn't be committed just yet
2008-10-30 17:24:40 +00:00
Roan Kattouw
095803abf5
API: Tweak r42794 (add docs for ApiBase class constants) a little
2008-10-30 14:51:57 +00:00
Roan Kattouw
d5ed68afaa
API: Self-revert r42811 (BREAKING CHANGE: Putting meta=siteinfo output in <siteinfo> element for consistency with every other API module.). On second thought, it's not really necessary.
2008-10-30 14:43:41 +00:00
Roan Kattouw
20dd6fdb02
API: BREAKING CHANGE: Putting meta=siteinfo output in <siteinfo> element for consistency with every other API module. Previously, it was just put in the <query> element, where it doesn't belong.
2008-10-30 14:36:05 +00:00
Chad Horohoe
072649ebe8
Add some docs on these class constants
2008-10-30 00:39:21 +00:00
Aaron Schulz
eef0d25777
Don't show orphaned revisions (will matter for bug 11402 later)
2008-10-29 04:17:31 +00:00
Domas Mituzas
22f8f4ca17
usertext, not user :)
2008-10-28 18:49:00 +00:00
Alexandre Emsenhuber
1cf75c3fb4
Fixes for r42735:
...
* option's name is USE INDEX
* use the index is user_timestamp (per domas)
* force it on the 'revision' table, not 'page'
2008-10-28 18:42:49 +00:00
Chad Horohoe
efad3a8b76
Use FORCE INDEX here, because Domas said we should :) All hail Domas.
2008-10-28 17:51:38 +00:00
Roan Kattouw
2c4eae4b92
API: (bug 16158) Generators choke on pagelinks entries with negative pl_namespace. Throw a warning instead of an error for the time being
2008-10-28 14:35:48 +00:00
Roan Kattouw
5a18b6aa4e
API: * (bug 16159) Add wlshow=patrolled|!patrolled to list=watchlist
...
* Followup of r42077: fix bug 15945 (use User::useRCPatrol() and useNPPatrol() rather than isAllowed('patrol')) for list=watchlist as well
2008-10-28 14:20:29 +00:00
Roan Kattouw
969761e440
API: Also throw a warning when tokens for missing pages are denied
2008-10-27 12:16:47 +00:00
Roan Kattouw
40152f0aea
API: Per IRC conversation with Splarka, add a few words about token availability from prop=info in the help text for action=block and action=unblock
2008-10-27 12:06:49 +00:00
Roan Kattouw
ced78b9748
API: (bug 16126) Added siprop=magicwords to meta=siteinfo
2008-10-26 13:57:19 +00:00
Roan Kattouw
f6363295b4
API: Fixing r42583: true isn't even allowed as a default value
2008-10-26 10:47:13 +00:00
Roan Kattouw
e7c507a57a
API: (bug 16115) API action=block dies with an exception when $wgBlockAllowsUTEdit is not a boolean (e.g. set to 1). While this shouldn't be done, of course, we can at least handle it more gracefully.
2008-10-25 22:22:22 +00:00
Alexandre Emsenhuber
925846c7d5
Do a last check before creating the object to not throw a fatal error when calling api.php?format=
2008-10-25 16:23:09 +00:00
Roan Kattouw
f8dc72921f
API: (bug 16105) Image metadata attributes with spaces produce invalid XML. Just replace spaces with underscores in the XML formatter and be done with it.
2008-10-25 15:53:58 +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
Tim Starling
c5bd0fae09
Removed scary YAML parsing code, the function of which is to load from a user input string, except if the string has no line breaks in it, in which case an arbitrary local file/URL is loaded and handed to the attacker on a nicely encapsulated silver platter. Doesn't appear to be used either by core or extensions, but you never know when someone might try.
2008-10-25 14:01:35 +00:00
Tim Starling
c4dd73000a
* Fix r41814: totally broken use of empty(), ignores conditions that compare with numeric zero. I've told you before, don't use empty() to test for zero-length arrays.
...
* Fix r34767: wrong indexes used in ApiQueryLogEvents
2008-10-25 08:13:40 +00:00
Roan Kattouw
a901d184dd
API: * Fix up r42471 which hardcoded pl_from instead of using $this->bl_from
...
* Fix the second half of bug 16076 (using pl_from>=123 in combination with multiple values for pl_namespace and pl_title causes filesort)
* By pure accident this fixes a bug about list=backlinks&blredirect dropping results under obscure conditions
2008-10-24 22:22:40 +00:00
Roan Kattouw
31cf2fef2d
API: Partial fix of bug 16076: use pl_from instead of page_id in list=backlinks query. The two are equal because of the JOIN clause, but pl_from is indexed whereas page_id isn't (MySQL 5 automatically rewrites this, 4 doesn't)
2008-10-24 18:54:02 +00:00
Roan Kattouw
6ad1e45cd9
API: * BREAKING CHANGE: (bug 16074) Providing prop=revisions&rvprop=content with too many titles or revisions (typically through a generator) no longer causes an error, but a warning
...
* Added ApiBase::truncateArray() and used it in ApiBase::parseMultiValue()
2008-10-24 13:05:44 +00:00
Roan Kattouw
ee3e7075a5
API: Added redirect resolution to action=parse. Based on a patch by Robert Chin
2008-10-24 12:28:14 +00:00
Roan Kattouw
58ed5d34bf
API: (bug 16047) Added activeusers attribute to meta=siteinfo&siprop=statistics output
2008-10-22 12:16:24 +00:00
Alexandre Emsenhuber
018f7d9854
Per Catrope's request, commiting patch on bug 16018:
...
* (bug 16018) Added uccontinue parameter to list=usercontribs so paging works properly when multiple users are queried or a userprefix is used
2008-10-18 10:14:02 +00:00
Alexandre Emsenhuber
0d0d7b5559
Per Catrope's request, commiting patch on bug 16017:
...
* (bug 16017) list=categorymembers sets invalid continue parameters for sortkeys containing pipes
2008-10-18 10:09:19 +00:00
Roan Kattouw
1be7d14726
* API: (bug 15995) Added cmstartsortkey and cmendsortkey parameters to list=categorymembers, mirroring cmstart and cmend for timestamps
...
* Drop useless and possibly filesorting ORDER BY cl_to from list=categorymembers
* Handle ORDER BY cl_sortkey, cl_from (possibly with DESC appended to each of them) with addWhereRange() calls
2008-10-17 14:26:56 +00:00
Roan Kattouw
a3714f5f37
(bug 15985) Fix acfrom and aifrom breakage when sorting in descending order
2008-10-16 14:28:49 +00:00
Roan Kattouw
abd56027c8
(bug 15945) API: Use User::useRCPatrol() and useNPPatrol() rather than isAllowed('patrol') in list=recentchanges
2008-10-14 12:46:11 +00:00
Ilmari Karonen
d01d0edd98
Use getParameter() for the "maxage" and "smaxage" parameters rather than pulling them straight out of the request
...
so that they'll be properly validated (and in particular coerced to integers).
2008-10-10 17:09:53 +00:00
Roan Kattouw
798cc41a51
(bug 15881) API: Empty or invalid parameters cause database errors
2008-10-07 18:23:39 +00:00
Roan Kattouw
3ff1f89e0c
* (bug 15845) API: Added pageid/fromid parameter to action=delete/move, making manipulation of legacy pages with invalid titles possible
...
* Fix an E_STRICT while I'm at it
2008-10-07 14:57:59 +00:00
Roan Kattouw
c7f10c73d9
(bug 15767) API: apfilterlanglinks returns duplicate results
2008-10-05 09:35:47 +00:00
Roan Kattouw
059e2f8160
API: Add examples for list=duplicatefiles
2008-10-04 21:54:11 +00:00
Roan Kattouw
bb71d34114
Remove debugging code
2008-10-04 15:06:24 +00:00
Roan Kattouw
0828169b6b
API: Add allowsduplicates attribute to action=paraminfo output
2008-10-04 15:03:03 +00:00
Roan Kattouw
212720fa28
API: * (bug 15785) Allow for different expiry times for different protections, like the UI does
...
* BREAKING CHANGE: Alter action=protect output to display multiple expiry times
* BREAKING CHANGE: Error messages invalidexpiry and pastexpiry now state the expiry they're about
* Add ApiBase::PARAM_ALLOW_DUPLICATES and honor it in ApiBase::getParameterFromSettings()
2008-10-04 14:58:13 +00:00
Roan Kattouw
7bb4064436
Add a meaningful example for list=watchlistraw
2008-10-04 14:30:33 +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
Roan Kattouw
5c4efbf944
(bug 15768) Add list=watchlistraw to the API
2008-10-04 13:33:44 +00:00
Matt Johnston
fdc01ccef2
(bug 8440) Add API support for new blocking flag, also fix defaults so anywhere else we use an IPBlockForm it'll use a more sensible default.
2008-10-02 09:34:29 +00:00
Ilmari Karonen
69c1dd9e7e
Make the API maxlag check send the same "Retry-After" and "X-Database-Lag" headers as wfMaxlagError() does.
...
The HTTP status code is still different, I can see arguments for having it either way.
2008-10-01 21:38:13 +00:00
Matt Johnston
cd7aa10e89
(bug 15791) Typo in API docs, APIProtect has some remnants of help messages from deletion/restoration.
2008-09-30 21:03:38 +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
f7748d570b
(bug 15653) Add prop=duplicatefiles to the API
2008-09-27 11:42:28 +00:00
Roan Kattouw
eea6c59c96
Kill undefined variable warnings.
2008-09-27 11:26:34 +00:00
Roan Kattouw
26c2b5264d
API: Add the name attribute back to list=allimages; it disappeared in r35085
2008-09-27 11:04:23 +00:00
Roan Kattouw
c2383bff2b
Forgot to commit a file in my TODO/FIXME crusade.
2008-09-25 22:41:03 +00:00
Roan Kattouw
a24da23922
We can at least *pretend* to be consistent here
2008-09-25 21:41:13 +00:00
Roan Kattouw
b62ddd3971
API:
...
* Title::moveTo() has been returning a getUserPermissionsErrors()-like array for ages now, let's use it correctly in ApiMove and skip the double-checks
* Remove some outdated TODO/FIXME comments
2008-09-25 21:39:36 +00:00
Roan Kattouw
008b4f7d0f
API: Add ApiDisabled and ApiQueryDisabled classes so individual modules can be disabled by putting $wgAPIModules['foo'] = 'ApiDisabled'; in LocalSettings.php
2008-09-25 20:50:50 +00:00
Roan Kattouw
3b86e96992
Do it right this time
2008-09-25 20:47:47 +00:00
Roan Kattouw
3ed4a18c6e
API: Fix adding over prop/list/meta modules, which seems to have been broken for a long time without anyone noticing.
2008-09-25 20:46:24 +00:00
Roan Kattouw
7dc62e75ed
(bug 15609) Add inprop=url (full URL to page and edit form) and inprop=readable (whether the current user can read the page) to prop=info
2008-09-25 15:55:09 +00:00
Roan Kattouw
4c7206a478
Followup to r41257: don't give out a token when we're in JSON callback mode
2008-09-25 15:27:04 +00:00
Roan Kattouw
09ccd3adbe
API: Added uiprop=preferencestoken to meta=userinfo, to retrieve the token for chaning one's preferences through Special:Preferences (and possibly through a future API module if and when the preferences system doesn't suck so much anymore).
2008-09-25 15:20:37 +00:00
Roan Kattouw
352d3f6dfb
(bug 15706) Empty values for apprtype and apprlevel are now silently ignored rather than causing an exception
2008-09-25 14:50:09 +00:00
Roan Kattouw
b3d5508c10
(bug 15673) Add indentation and newlines to format=wddxfm output:
...
* Like the JSON formatter, use our own WDDX formatter when PHP's is not available or the user asked for pretty output (PHP's doesn't do indentation)
* Don't prettify when our own formatter is used because PHP's is not avaiable
* Detect regular arrays (with sequential integer keys) and use <array> for them, rather than using <struct> for all arrays. PHP's formatter does this as well. This change should make our WDDX formatter's output identical to PHP's
2008-09-25 14:23:24 +00:00
Tim Starling
7410147d02
Fixes for r41154 and r41155:
...
* Boolean parameters are widely accepted to reduce readability. Replaced the new boolean parameters with class constant parameters instead.
* Re-added Revision::revText(), for backwards compatibility
* The getUser()/getUserText() changes near line 1223 of SpecialUndelete.php were incorrect, $file is an ArchivedFile not a Revision, and doesn't have any $isPublic parameters.
2008-09-24 09:44:45 +00:00
Aaron Schulz
804deee936
rev_deleted security improvements as well as fix for rawpages
2008-09-22 14:37:05 +00:00
Tim Starling
9f84a2fe83
Log exceptions encountered in api.php. Check for null $wgRequest.
2008-09-21 09:38:55 +00:00
Tim Starling
b47bb18aad
Fixed more wfGetDB() calls with no arguments.
2008-09-21 09:15:28 +00:00
Chad Horohoe
dc404545e0
Fix some doxygen stuff.
2008-09-19 00:21:03 +00:00
Alex Z
1f5da24b79
*Don't let the API action=protect set actions that aren't in $wgRestrictionTypes or levels not in $wgRestrictionLevels
...
*Pass an array to Article::updateRestrictions for the expiry. Though it should allow for separate expiry times, like the normal UI.
2008-09-18 21:30:51 +00:00
Roan Kattouw
353345d6ab
API: Adding APIAfterExecute, APIQueryAfterExecute and APIQueryGeneratorAfterExecute hooks to make extending core modules possible in a cleaner way
2008-09-17 18:49:22 +00:00
Thomas Bleher
4e9dacf069
Escape $1 in message (was PHP syntax error)
2008-09-14 14:24:54 +00:00
Aaron Schulz
13712ac86c
Revert r40792. Filesort is gone, but table scan is still there for time range.
2008-09-13 20:41:58 +00:00
Roan Kattouw
7237a1cecd
Reverting r40790 and fixing the filesort properly (by adding an extra ORDER BY clause).
2008-09-13 18:10:23 +00:00
Aaron Schulz
2f7dc78c07
I swear this table scan filesort was disabled before. Disabling again...thanks to Vyznev for pointing this out.
2008-09-13 17:56:07 +00:00
Chad Horohoe
15f016d1cb
Remove unused global declaration.
2008-09-11 02:03:34 +00:00
Roan Kattouw
6a2f8c1193
* (bug 15497) Removed encoding attribute from <?xml ?> tags
2008-09-10 13:39:24 +00:00
Roan Kattouw
35c661f308
Tweaks for r40686, r40687:
...
* Instead of type=boolean, just use false (that's the way it's done everywhere else)
* Remove bug number from RELEASE-NOTES entry; bug is in no way related to rnrandom
2008-09-10 13:30:42 +00:00
X!
3ddb14efa3
Add rnredirect parameter, to get a random redirect instead of a random page
2008-09-09 23:30:29 +00:00
Roan Kattouw
3256fbb3bf
(bug 15535) prop=info&inprop=protection doesn't list pre-1.10 protections if the page is also protected otherwise (1.10+ style or cascading)
2008-09-09 20:42:19 +00:00
X!
6540ad122f
Fix action=rollback to now revert IPs too. Patch submitted by ST47.
2008-09-08 23:33:42 +00:00
Roan Kattouw
b8e624d367
API: Uniformizing descriptions for write modules
2008-09-07 19:12:41 +00:00
Roan Kattouw
76635483de
(bug 15359) Add APIGetAllowedParams and APIGetParamDescription hooks
2008-09-07 19:04:51 +00:00
Victor Vasiliev
9e7fc0ae21
* (bug 15492) list=recentchanges&rctype=log does't list log action
...
Patch by Roan Kattouw
2008-09-06 12:18:36 +00:00
Roan Kattouw
244fa33d3d
(bug 15486) API action=block ignores autoblock parameter
2008-09-05 15:05:57 +00:00
Tim Starling
96d89329f3
* Don't force rendering in File::getThumbnail(). The old code (pre-filerepo) required rendering to be forced all the time, the new code is much smarter about when to render and doesn't need rendering to be forced. Forcing rendering causes non-scaler servers to be used for scaling.
...
* Use File::transform() in the core instead of the deprecated File::getThumbnail().
2008-09-05 04:23:24 +00:00
Alexandre Emsenhuber
78ca64e449
missing svn:keywords property
2008-09-04 22:20:32 +00:00
Roan Kattouw
b624df0d43
(bug 15466) Added action=purge to the API. Modified patch by ^demon
2008-09-04 21:53:43 +00:00
Roan Kattouw
def0843a31
(bug 15479) action=login no longer sets wait parameter when result="Throttled"; regression from r40054
2008-09-04 19:48:48 +00:00
Roan Kattouw
bd3bf5d2a7
* Split patrol code
...
** Backend code moved to RecentChange::reallyMarkPatrolled() and doMarkPatrolled()
** Adapted Article::markpatrolled()
* (bug 15466) Added action=patrol to the API. Modified patch by Soxred93
* Added rctoken=patrol to list=recentchanges
* Detect duplicate warnings in ApiBase::setWarning()
2008-09-04 15:17:51 +00:00
Roan Kattouw
0f639816ce
(bug 15471) Fix regression from r40088 which caused apprefix=Main_Page/ to fail because Main Page/. is not a valid title
2008-09-04 13:42:22 +00:00
Roan Kattouw
b294f9a437
(bug 15473) Correcting Doxygen comment for ApiEditPage
2008-09-04 13:40:33 +00:00
Roan Kattouw
1881098b81
(bug 15448) YAML output returns empty strings instead of 0. Surprisingly, this was not caused by PHP's "helpful" 0=='' ; research shows this was a regression from r32485 that no one ever noticed
2008-09-03 14:47:49 +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
Tim Starling
fde6099061
header() replaces by default, there's no need to pass a second parameter
2008-09-01 04:32:36 +00:00
Bryan Tong Minh
35b2c4d391
* (bug 15392) ApiFormatBase::formatHTML now uses $wgUrlProtocols.
2008-08-31 17:11:22 +00:00
Bryan Tong Minh
a66bffaedf
Fix for my previous commit: Filter out null values
2008-08-29 21:49:36 +00:00
Bryan Tong Minh
145775132b
Add a function to require one and only one parameter of a list.
2008-08-29 21:09:18 +00:00
Bryan Tong Minh
6578dd7890
wfReadOnly now checked in ApiMain::requestWriteMode
2008-08-28 20:25:53 +00:00
Roan Kattouw
af6543ff56
(bug 15348) prop=categories returns timestamps that aren't in ISO 8601 format
2008-08-28 16:26:27 +00:00
Roan Kattouw
fb84c15c1e
API:
...
* Add titlePartToKey() and keyPartToTitle() which use the substr() hack to preserve trailing spaces
* Migrate function calls where needed. ??continue parameters still use titleToKey() because they're generated using keyToTitle() and therefore can't contain trailing spaces
2008-08-27 16:48:30 +00:00
Roan Kattouw
f35031994a
Fix fatal error caused by missing comma
2008-08-27 16:40:29 +00:00
Bryan Tong Minh
a9fd7beaef
* Fixup validation methods in UserEmailForm a bit so that they don't return arrays when it's not necessary.
...
* Add email errors to the API's message map
2008-08-27 13:36:39 +00:00
Roan Kattouw
880d5655cb
API: Remove the throttle from ApiLogin because
...
* it's been obsoleted by a similar throttle in core
* it uses time(), which causes problems when you have multiple servers with a significant clock skew between them
2008-08-26 22:18:24 +00:00
Roan Kattouw
34a22d81f5
API: Improvements to action=emailuser:
...
* Add two messages from ApiEmailUser to ApiBase::$messageMap
* Add email tokens to prop=info
2008-08-26 21:34:47 +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
Aryeh Gregor
24d7986f49
Set svn:eol-style native on includes/api/ApiWatch.php.
...
Reported on IRC by rindolf.
2008-08-25 17:57:20 +00:00
Daniel Friesen
69e49e832e
ApiQueryBase::titleToKey and ApiQueryBase::keyToTitle;
...
Don't bother constructing a title object when the $title/$key is ''. (Why were we doing this check after creating the title object, there's no point in even creating a big object if we're just going to check the old string we already had to see if it's empty)
And as a bonus, use trim() so that user input such as ' ' does not dish out an error (There really isn't much difference between "&title=" and "&title= " if one shouldn't output an error, why should the other?).
2008-08-25 06:57:15 +00:00
Daniel Friesen
4fcb1312f2
Revert 39936 and 39935;
...
This 'fix' is merely a bad workaround and creates more issues rather than simply fixing.
A) Part of the Title class is being /duplicated/ meaning more bugs are going to show up when someone improves stuff inside Title and doesn't know stuff is duplicated here.
B) This change breaks cases as $wgCaptialLinks is now a per-namespace array, not a boolean.
C) This is the wrong way to 'fix' the issue, titleToKey and keyToTitle are meant to handle full titles, not prefixes, the issue is not that they break prefixes, it's that they are being misused and thus outputting something other than expected. The best way to fix this issue, would probably be to pad the title with something like '.' and then strip that single character off the db key.
D) Because whitespace is no longer being trimmed actual titles aren't being normalized properly in the other modules causing 'foobar ' to attempt to use the db key 'foobar_' which cannot exist.
2008-08-25 06:50:31 +00:00
Roan Kattouw
27cb2f9ab0
Follow-up for r39935: re-fix bug 14651 by making the first letter uppercase if needed in keyToTitle(). Code stolen from Yuri in r17039, who removed the functionality without explanation in r17096. So much for today's history lesson.
2008-08-25 05:51:46 +00:00
Roan Kattouw
511ae2aca2
API: Go back to using the good old str_replace() hacks rather than Title methods in ApiQueryBase::titleToKey() and keyToTitle(). Error handling was awkward and the Title methods over-normalize the input, causing bug 15275 (apprefix ignores spaces at the end)
2008-08-25 05:41:53 +00:00
Brion Vibber
be28c3980a
Revert r39793 "* (bug 13879) Special:EmailUser shows a form in case no user was specified" for the moment
...
* Recipient name seems to be output raw into HTML form; this is insecure
* We've lost the link to the target's user page in the primary use case (followed 'email this user' link)
* Behavior if you misspell a name doesn't look very nice; you can't just fix it and resubmit the form, you have to hit 'back' from an error page and hope your browser isn't one that deletes all your form data :D
2008-08-21 22:56:45 +00:00
Bryan Tong Minh
e751a22a2f
* (bug 13879) Special:EmailUser shows a form in case no user was specified
2008-08-21 22:15:34 +00:00
Roan Kattouw
44475e0314
Adding action=watch to the API
2008-08-21 15:44:13 +00:00
Bryan Tong Minh
f830c86e06
Provide some info on which case value was not handled in ApiLogin
2008-08-20 19:56:18 +00:00
Bryan Tong Minh
2776bbd98e
Fix up my name.
2008-08-19 15:08:14 +00:00
Roan Kattouw
309e57fd4a
API:
...
* BREAKING CHANGE: list={backlinks,embeddedin,imageusage} now return an array with keys 0, 1, 2, ... (list) rather than an array with pageIDs as keys (hash table/associative array) for consistency with other list= modules.
* Attempting to fix an error about "Invalid title ``''" (i.e. empty string as title) I encountered at Wikipedia.
2008-08-19 15:05:29 +00:00
Roan Kattouw
fe833aeddc
(bug 15228) Throw a warning instead of an error when revids= and redirects are combined. Also fixed a bug that caused warnings thrown in ApiPageSet.php to appear in an <ApiPageSet> tag rather than <query>
2008-08-18 20:48:45 +00:00
Roan Kattouw
f758f07e8d
(bug 15178) Added clshow to prop=categories to allow filtering for hidden/non-hidden categories
2008-08-16 21:21:12 +00:00
Roan Kattouw
6071d72917
(bug 15173) Make prop={links,templatelinks} not break in PostgreSQL
2008-08-16 21:02:31 +00:00
Roan Kattouw
2059e76f81
API: Let list=search throw away missing titles. Lucene will sometimes give us pages that have recently been deleted.
2008-08-16 21:00:19 +00:00
Roan Kattouw
8ca02215a8
API: Fixing an E_NOTICE reported by Wikia. Can't reproduce locally, but an extra @ can't hurt.
2008-08-16 20:52:56 +00:00
Fran Rogers
b63b22fc47
Patch from MaxSem re bug 15162 - handle throttling in the login API
2008-08-16 18:43:02 +00:00
Fran Rogers
851eaecd50
Wrapped certain tricky constructs in @cond/@endcond to prevent Doxygen
...
from choking on them and segfaulting.
2008-08-06 03:55:49 +00:00
Roan Kattouw
5331e82bd5
API:
...
* (bug 15048) Added limit field for multivalue parameters to action=paraminfo output.
* When the limit on multivalue parameters is exceeded, a warning is issued
2008-08-05 16:32:28 +00:00
Roan Kattouw
606d921911
* (bug 15044) Added requestid parameter to api.php to facilitate distinguishing between requests
...
* Clean up indentation from r38566
* Use $this->mRequest rather than $wgRequest in ApiMain
2008-08-05 16:12:52 +00:00
Chad Horohoe
dc91b3b12d
Badaccess-group1/2 no longer exist.
2008-08-05 14:44:00 +00:00
Roan Kattouw
25b6fa8d24
* Mention multivalue parameters in the message about apihighlimits
...
* Add Bryan Tongh Minh to the API credits. Half of all image-related code is his
* Add myself to CREDITS. Why do we sort that by first name, though? Kind of weird
2008-08-04 14:37:26 +00:00
Chad Horohoe
6959321d61
Display permissions specific to the API (such as writeapi and apihighlimits) on action=help. For apihighlimits, give the limits they're held to (bug 14713)
2008-08-04 14:26:20 +00:00
Chad Horohoe
4426ed9527
Tweak the version info for MW just a bit, bring it more in line with the module listings in terms of formatting.
2008-08-02 14:51:40 +00:00
Bryan Tong Minh
e2564980c3
API: Added iiprop=bitdepth to imageinfo and aiprop=bitdepth to allimages
2008-07-31 20:10:36 +00:00
Victor Vasiliev
d4ceec6775
* (bug 14968) Specifying blank action parameter triggers API error now
2008-07-30 07:23:22 +00:00
Chad Horohoe
14a80040bf
Deprecate SiteStats::admins() in favor of SiteStats::numberingroup('sysop'). Should make bug 13471 easy.
2008-07-28 15:49:44 +00:00
Brion Vibber
c85a7e6c83
* API search now falls back to fulltext search by default when using Lucene
...
or other engine which doesn't support a separate title search function.
This means you can use API search on Wikipedia without explicitly adding
&srwhat=text to the query.
2008-07-27 21:31:11 +00:00
Rotem Liss
81874262b1
API change: Registration time of users registered before the DB field was created is now shown as empty instead of the current time.
2008-07-25 13:59:24 +00:00
Roan Kattouw
dde1b39e7e
API: Change descriptions for some limit parameters to actually refer to the correct type of result
2008-07-22 13:26:15 +00:00
Roan Kattouw
050e1c7380
Cleanup from r37839: just put ipb_auto in the relevant arrays. We have those arrays so we don't have to add if($fld_a || $fld_b) for every crazy flag combination in existence.
2008-07-21 21:37:11 +00:00
Brion Vibber
81f62b9ff8
Security fix for API blocks query -- ipb_anon field wasn't being loaded when querying for usernames but not flags, but this field is needed to tell whether a given row is an autoblock and needs the IP suppressed.
2008-07-19 07:50:14 +00:00
Brion Vibber
6d97c46db4
Revert r37748 "(bug 14020) Added an API interface to Special:Unwatchedpages in the form of the apfilterwatched parameter to list=allpages. If $wgMiserMode is true or if the user doesn't have the 'unwatchedpages' right, apfilterwatched is ignored and a warning is output."
...
This is broken -- watched page filter results in a huge wash of duplicate rows -- one for each watcher for each page.
2008-07-17 09:26:01 +00:00
Roan Kattouw
9537e2dea7
(bug 14020) Added an API interface to Special:Unwatchedpages in the form of the apfilterwatched parameter to list=allpages. If $wgMiserMode is true or if the user doesn't have the 'unwatchedpages' right, apfilterwatched is ignored and a warning is output.
2008-07-16 15:42:55 +00:00
Roan Kattouw
f933cff042
Redoing r37642 ('Added possibility to filter by protocol in "list all links" mode') *really* right this time, the example broke because I had 'http' instead of 'http://' on line 78.
2008-07-15 22:03:34 +00:00
Brion Vibber
4d420fc5e2
Revert r37717 -- if you didn't like the other reasons, the fact that it obviously wasn't tested and breaks the example might interest you.
2008-07-15 21:53:36 +00:00
Roan Kattouw
4651016b50
Revert r37712 which was itself a revert of r37642 (filter by protocol in list-all-links mode). $protocol is validated already: only protocols in $wgUrlProtocols are accepted (line 168) and the : (and, if required, //) part is added in lines 57-65, making both reasons for the revert moot.
2008-07-15 21:29:27 +00:00
Brion Vibber
204d23f1d6
Revert r37642 for now ('Added possibility to filter by protocol in "list all links" mode.'):
...
* doesn't properly validate $protocol when building like query for protocol-only case, could lead to ugly slow arbitrary queries
* no : added to protocol -- will match false positives (eg 'http' matching 'https')
2008-07-15 20:51:07 +00:00
Roan Kattouw
3fd59b7133
API list=exturlusage: Added possibility to filter by protocol in "list all links" mode. euprotocol now accepts an empty string too, which is interpreted as "list all links" if euquery is empty, and silently interpreted as 'http' if euquery is not empty, to preserve backwards compatibility.
2008-07-14 12:04:04 +00:00
Roan Kattouw
dc4efc975b
Revert most of r37534, which was an over-revert: just changing addQuotes() back to strencode() was enough.
2008-07-10 21:20:43 +00:00
Brion Vibber
0b0b33cd52
Partial revert of r37502, 37503: double-quoting of SQL strings
2008-07-10 21:08:37 +00:00
Roan Kattouw
268f78e083
API: More cleanup:
...
* Cleaning up some comments
* Breaking the description for iiurlwidth in two lines
* Clarifying the descriptions for amfilter and amlang
2008-07-10 14:28:09 +00:00
Roan Kattouw
0df4098652
Forgot to change one strencode() to addQuotes()
2008-07-10 14:19:06 +00:00
Roan Kattouw
d4bebe41ce
API: Some cleanup and fixes before 1.13 is released:
...
* Fix regression from r37270: prop=categories paging was broken in generator mode.
* Fix drlimit=max, which was broken since r31384
* Use titleToKey() and keyToTitle() on title parts of the continue parameters in prop={links,templatelinks,categories,images}
* Use addQuotes() rather than strencode() in those same modules
* Don't trim message names in ammessages, it's stupid and undocumented
* Add $wgAPI{Meta,Prop,List}Modules to DefaultSettings.php explicitly
2008-07-10 14:13:11 +00:00
Bryan Tong Minh
f2962d36cd
* Added flag "top" to list=usercontribs if the user is the last contributor to the page
...
* Limited API section in RELEASE-NOTES to 80 chars
2008-07-09 11:44:49 +00:00
Roan Kattouw
f299cc1fc7
(bug 14758) unknown_action message was output twice, once formatted and once unformatted
2008-07-08 20:53:41 +00:00
Bryan Tong Minh
cb6b08b17b
User::editToken expects the salt as an array, not as variable length argument list.
2008-07-08 08:42:27 +00:00
Roan Kattouw
afedf99ebe
API: Add paging (i.e. limit and continue) parameters to prop={links,templatelinks,langlinks,extlinks,categories,images}. This means that these modules will no longer request data from the database without a LIMIT, and that clients will have to use the query-continue method to get all the results.
2008-07-07 17:32:22 +00:00
Roan Kattouw
ad4dadc8ec
API list=alllinks:
...
* Make paging actually work by ordering by namespace too
* Make paging in generator mode work by always requesting pl_title
2008-07-07 14:48:40 +00:00
Roan Kattouw
00d4f3c482
Killing filesort in prop={links,templatelinks} when {pl,tl}namespace isn't set.
2008-07-07 13:08:03 +00:00
Roan Kattouw
1fabded56d
API: Add description for alcontinue parameter
2008-07-07 12:48:10 +00:00
Tim Starling
fd1854de57
Fix silent failure in PHP 5.1.x or older. The callback for static functions is array('class', 'method').
2008-07-07 07:57:24 +00:00
Brion Vibber
38831a4ba0
Fix for PHP < 5.2.3
...
'Foo::bar' is not a valid callback on earlier versions of PHP;
must specify as array( 'Foo', 'bar' )
2008-07-06 18:43:06 +00:00
Roan Kattouw
07db2080a5
Fix regression from r37046: tokens should not be supplied when in JSON callback mode. Also remove ApiQueryBase::getTokenFlag() which is now obsolete.
2008-07-05 11:18:50 +00:00
Brion Vibber
dae4d46723
Revert r37009 -- turns out you can do these structures, it's just very nonobvious. :)
...
An anonymous sub-array allows creating sub-elements in addition to the attributes:
array(
'attrib1' => 'val1',
'attrib2' => 'val2',
array(
'tag' => 'stuff',
'tag2' => 'stuff2',
)
)
2008-07-04 22:44:57 +00:00
Roan Kattouw
0104fa1f0c
Rewritten the way the API handles tokens:
...
* Instead of hardcoding stuff all over the place, use callbacks
* Extensions can now add their own tokens to prop=info or prop=revisions using hooks
2008-07-04 12:07:02 +00:00
Victor Vasiliev
ed66838f12
* (bug 14723) Added time zone and writing direction to meta=siteinfo. Patch by MaxSem
...
* Some random cleanup
2008-07-04 09:21:11 +00:00
Brion Vibber
4e4be177e4
Have been playing with custom API modules and been a bit frustrated with the XML output mode...
...
Adding pseudo-element _attribs alongside _element for XML output. There doesn't seem to be a good way currently to specify both attributes *and* subelements -- '*' lets you have text and attributes, but not sub-elements and attributes. Contents of _attribs will be added as attributes without disturbing the sub-elements.
2008-07-03 21:25:20 +00:00
Roan Kattouw
18a33b842b
ApiParse: Don't display revid="" when there is no revid.
2008-07-03 15:01:50 +00:00
Roan Kattouw
d4fe7a3763
Another regression from r36678: dieUsageMsg() expects an array, not varargs.
2008-06-29 22:29:08 +00:00
Roan Kattouw
826bcef0fa
Fix regression from r36678: we can't use $this->dieUsageMsg() in a static method, so let's make ApiQueryBase::keyToTitle() and titleToKey() non-static.
2008-06-29 22:26:23 +00:00
Chad Horohoe
e539d06170
(bug 14678) Make API respect $wgShowSQLErrors and $wgShowExceptionDetails. Patch by Max Semenik.
2008-06-29 00:07:13 +00:00
Bryan Tong Minh
832131ce73
Added clprop=timestamp to prop=categories
2008-06-27 20:35:43 +00:00
Roan Kattouw
87711e1bc7
Fix fatal errors introduced in r36678
2008-06-27 10:37:40 +00:00
Roan Kattouw
ff1354373c
Use the proper Title methods in ApiQueryBase::titleToKey() and keyToTitle(). This fixes bug 14651 for much more than just apprefix.
2008-06-26 15:48:44 +00:00
Roan Kattouw
4be00dd978
API:
...
* (bug 14605) Adding readonly field to meta=siteinfo&siprop=general
* Unifying coding style in ApiQuerySiteinfo
2008-06-21 15:13:26 +00:00
Roan Kattouw
21e108b5ff
Oops, gotta use $exp here
2008-06-21 15:06:40 +00:00
Roan Kattouw
10c679488c
Revert live hack from r36493, because it has no effect whatsoever.
...
$params['action'] cannot be an invalid action, because the $params array is filled by ApiBase::extractRequestParams() which checks whether the parameters are valid and throws an error message (ironically implemented with a UsageException) if they're not.
2008-06-20 10:51:17 +00:00
Brion Vibber
cc722a0b4c
Apply live hack -- exception for invalid actions (as opposed to....?)
2008-06-19 23:48:09 +00:00
Roan Kattouw
c6bf702b93
API: Added bkip parameter to list=blocks. This more than fixes bug 14405.
...
About the database query: I know it filesorts the result set, but that shouldn't cause any trouble as the result set is always small. To be more specific: it cannot be larger than 17 rows. This is because bkip=foo only grabs (range) blocks that contain foo *in its entirety*. Therefore, in the worst case foo is a single IP and the result set will consist of a single block, a /31 range block, a /30, etc. to /16 (blocks that cross /16 , which adds up to 17 blocks (note that there's only one /N range that a /N+K range is part of).
2008-06-19 13:43:14 +00:00
Roan Kattouw
a1d340cb43
Add maxage too
2008-06-16 20:06:23 +00:00
Roan Kattouw
044ad0c0ce
(bug 14402) Added smaxage parameter to api.php
2008-06-16 19:49:43 +00:00
Roan Kattouw
042a034033
API: Add nocreate parameter to action=edit
2008-06-15 20:37:28 +00:00
Roan Kattouw
4eaf657ebb
API: Adding 'hidden' field to list=allcategories and prop=categoryinfo output
2008-06-15 20:28:48 +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
Bryan Tong Minh
a250de2567
(bug 14526) Unescaped SQL in list=backlinks
2008-06-13 13:22:50 +00:00
Roan Kattouw
8b86f3bc01
(bug 14459) Added prependtext and appendtext parameters to action=edit
2008-06-12 13:05:07 +00:00
Roan Kattouw
8ed211efbf
(bug 14471) Use HTMLTidy and generate limit report in action=parse
2008-06-12 11:50:01 +00:00
Roan Kattouw
b3ba069578
Please use standardized error messages here
2008-06-12 11:43:15 +00:00
Tim Starling
5df0b9bbb7
Like the comment says... dieDebug() instead of wfHttpError
2008-06-10 15:20:22 +00:00
Aaron Schulz
f030fc2995
Tweak error messages
2008-06-05 00:00:07 +00:00
Aaron Schulz
966352ed2f
'0' is a title
2008-06-04 23:44:13 +00:00
Aaron Schulz
d808746a74
Title may come in as an empty string, which is not null, so the previous fails and lets a bad title slip in, which can make errors
2008-06-04 23:24:25 +00:00
Bryan Tong Minh
9cb4023d9f
... and should have also made this an array
2008-06-02 20:15:22 +00:00
Bryan Tong Minh
8da741008c
Forgot to return success
2008-06-02 20:11:11 +00:00
Bryan Tong Minh
74c2b22e84
Put ratelimiter and edittoken checking in backend.
2008-06-02 19:15:56 +00:00
Bryan Tong Minh
1a3664ee7e
API: Add action=emailuser
2008-06-01 17:58:27 +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
Bryan Tong Minh
f8a7159e6c
Always return an array if an error has occurred in Title::moveTo.
2008-05-30 19:59:47 +00:00
Bryan Tong Minh
04351dd272
Run UserLoginComplete hook from API
2008-05-29 19:23:37 +00:00
Bryan Tong Minh
cf40d9023d
(bug 14335) Use proper $wgUser methods instead of using $_SESSION
2008-05-29 18:57:06 +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
Roan Kattouw
f43e8e6857
In the spirit of r35407, don't go crazy if Title::moveTo() returns a string (which it sometimes does)
2008-05-27 16:54:14 +00:00
Roan Kattouw
379eb2210b
* Added 'writeapi' right that controls access to the write API. Users who don't have this right won't be able to use the write API modules even if $wgEnableWriteAPI = true; and they have the other rights required
...
* Checking for 'writeapi' in ApiMain::requestWriteMode() and tweaking the noapiwrite error message a bit
* Granting this right to *, user and bot by default.
For extra clarity: to e.g. move pages through the API, a user needs to have the 'move' right AND the 'writeapi' right AND $wgEnableWriteAPI = true;
2008-05-27 15:43:07 +00:00
Roan Kattouw
d478350295
* Refactor Title::isValidMoveOperation() and Title::moveTo() to return an array of arrays like Title::getUserPermissionsErrors() does; other functions used by the write API have undergone similar refactoring earlier
...
* Handle these return values in MovePageForm::doSubmit() and ApiMove::execute()
* Remove separate AbortMove hook calls from MovePageForm and ApiMove; these were used to capture the hook error, but the new return type handles that. Also, it resulted in two calls to that hook for each move
* Remove comment about SpecialMovepageAfterMove hook from ApiMove::execute(): we don't need it, there's the TitleMoveComplete hook for that. SpecialMovepageAfterMove is a UI hook that doesn't belong in the API
* Add imagenocrossnamespace and imagetypemismatch errors to ApiBase::$messageMap
2008-05-27 14:42:51 +00:00
Roan Kattouw
17b3fd4b63
API: Make action=block return an ISO 8601 timestamp rather than a UNIX timestamp
2008-05-27 10:18:28 +00:00
Aryeh Gregor
9eb97be793
No, something that looks stupid *is* in fact ipso facto stupid -- unless it includes a comment to explain why it's not.
2008-05-26 12:15:21 +00:00
Roan Kattouw
969e965da9
Fixing timestamp conversion breakage: ignores the fact that !isset($params['timestamps']) means we wanna restore everything.
2008-05-26 10:51:31 +00:00
Roan Kattouw
34e95f7e8b
Partial revert of r35058: when something looks stupid, that doesn't mean it is. This is done because the function in question expects a reference.
2008-05-26 10:14:58 +00:00
Bryan Tong Minh
c4370f6c73
On second thought file undeletion is supported; just not undeleting a specific file. Added relevant hook for this.
2008-05-24 20:48:45 +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
Aryeh Gregor
4ed81df65f
Code simplification (-205 bytes :P):
...
* Add MWNamespace::hasSubpages() and use that instead of $wgNamespacesWithSubpages everywhere
* Put early returns first, and don't else { } the rest of the code
2008-05-23 22:00:14 +00:00
Aryeh Gregor
033fd9b701
* Don't allow moving with subpages to a namespace that doesn't allow subpages. Such a move is only questionably reasonable, and even if reasonable it's not possible to revert it.
...
* Use a consistent test for whether a namespace permits subpages: empty(), not isset or boolean test with errors suppressed or a combination of those. The isset test alone (used in isSubpage()) is particularly broken because it returns true if the namespace is explicitly set to *not* allow namespaces, and only returns false if the entry is unset.
* Reshuffle some global declarations, simplify a conditional block
2008-05-23 17:09:28 +00:00
Roan Kattouw
ea12f3bcaa
(bug 14231) Tweak help for action=edit
2008-05-22 21:33:25 +00:00
Brion Vibber
a4ffac4063
Revert r35178 and normalize User's getID() and setID() methods to prettier getId() and setId()
...
This doesn't accomplish anything, of course, but if you're going to run around changing them, at least make em prettier eh? :)
2008-05-22 16:39:43 +00:00
Brion Vibber
fdbfd946ef
* Fix typo in ApiQueryImageInfo which made mime type query fail to work :)
...
* Fix ForeignAPIRepo's query to use the corrected parameter to the API
* ForeignAPIFile fixes to use queried mime type if available, and type-safety checks in case some values are missing or funny
2008-05-22 16:25:45 +00:00
Aaron Schulz
ae54dbbb3d
*The function is User::getID() not getId()
2008-05-22 14:57:07 +00:00
Roan Kattouw
903732fd15
API: Requesting a token you aren't allowed to request no longer dies with an error but just throws a warning and doesn't give you the token.
2008-05-21 14:33:27 +00:00
Bryan Tong Minh
7715a9a6b7
Add descriptionurl to imageinfo
2008-05-21 13:03:07 +00:00
Roan Kattouw
000f346c1b
Handle multiple warnings correctly in ApiBase::setWarning(). Calling this function twice from the same module used to throw a fatal error.
2008-05-20 19:43:50 +00:00
Roan Kattouw
119ca6e2ed
API: Unrecognized values for multivalue parameters now don't cause the API to abort with an error anymore, but just throw a warning and are ignored. This is useful for ??prop parameters, but also applies to other multivalue parameters such as list, meta and prop. Single values still throw an error like they used to.
2008-05-20 19:31:45 +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
Bryan Tong Minh
0204ede45d
Forgot to remove one debug statement.
2008-05-20 17:09:59 +00:00
Bryan Tong Minh
06c09e9835
Add RepoGroup::findFiles to efficiently find many files if the repo supports it. Added support for this in ApiQueryImageInfo.
2008-05-20 17:05:57 +00:00
Bryan Tong Minh
bad5057d7d
Forgot one $this => self when making ApiQueryImageInfo::getInfo static.
2008-05-20 14:34:19 +00:00
Bryan Tong Minh
28babe0e65
Use ApiQueryImageInfo::getInfo for both ApiQueryAllimages and ApiQueryImageInfo. Should also give some more consistency between the two modules.
2008-05-20 14:32:52 +00:00
Roan Kattouw
168f93e4a8
Unified aiprop and iiprop somewhat by adding iiprop=mime and aiprop=metadata. The size vs. dimensions discrepancy is weird, but won't be fixed for backwards compatibility. Also iiprop has user, comment and archivename because it handles file *revisions*, whereas allimages doesn't.
2008-05-20 09:16:01 +00:00
Brion Vibber
09edeb70bb
Reverting r35060 -- can't reproduce the reported problem so far, but if it exists this should be moved upstream so User::getGroups() and User::getRights() return consistent values themselves
2008-05-19 22:15:17 +00:00
Bryan Tong Minh
fdaf603064
Force indices of groups and rights array to be in order so that the JSON formatter recognizes it as a list instead of a dict in case for some reason rights or groups are removed somewhere in between (as done for sysops on testwiki).
2008-05-19 21:43:52 +00:00
Bryan Tong Minh
917587f08e
API: Merge file deletion code from ApiEdit_Vodafone branch.
2008-05-19 21:30:03 +00:00
Roan Kattouw
72b793a695
Remove deprecated ApiMain::scheduleCommit()
2008-05-18 20:15:56 +00:00
Tim Starling
a4eaa89625
* Fix unlogged automatic user creation: run wfLBFactory()->shutdown() 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).
2008-05-17 04:26:26 +00:00