Commit graph

1047 commits

Author SHA1 Message Date
Roan Kattouw
cb5fedd467 API: (bug 17873) Mention the 'g' prefix for generator parameters in the api.php help 2009-03-09 10:36:48 +00:00
Aaron Schulz
91094ea42d Fix check against wrong permission (should be 'hideuser') 2009-03-09 10:01:00 +00:00
Aaron Schulz
bab7396551 quick fix: add WHERE ar_deleted = 0. Nicer would be to make revision objects from the rows like queryRevisions does. 2009-03-09 09:08:40 +00:00
Alexandre Emsenhuber
9dd9379eb4 Per anomie's report on IRC: $wgMaxArticleSize is in kilobytes, not bytes 2009-03-07 17:37:29 +00:00
Roan Kattouw
24b290b453 Followup to r48122: missed one 2009-03-07 13:13:27 +00:00
Roan Kattouw
2f1af4d476 * API: (bug 17832) action=delete returns 'unknownerror' instead of 'permissiondenied' when the current user is blocked
* Fix this by changing all calls to current() to reset()
2009-03-07 12:58:41 +00:00
Rotem Liss
a5e5d8eb05 Fix typo. 2009-03-06 14:48:00 +00:00
Roan Kattouw
21fd7af97e * API: (bug 17774) API pretends action=query doesn't exist for users without read rights
* Instead of hiding read-restricted modules, throw an error when a user without read rights tries to use them
* Do the same for write modules when $wgEnableWriteAPI is false
* Indicate whether a module needs read or write rights in action=help and action=paraminfo
* BREAKING CHANGE: action=purge now requires write rights and, for anonymous users, a POST request
2009-03-06 13:49:44 +00:00
Chad Horohoe
7748725389 (bug 17795) Make meta=siteinfo respect $wgDisableCounters. 2009-03-05 13:52:14 +00:00
Roan Kattouw
c7ca98503a Fix up r47901: don't return the string "true" or "false", be consistent with the rest of the API 2009-03-01 11:02:49 +00:00
Nicolas Dumazet
fe53e8d894 For move logs, log_params can have a "suppressedRedirect" boolean, as a second parameter. Adding support to display it. 2009-03-01 05:13:42 +00:00
Roan Kattouw
5349ea2dd8 * API: (bug 13209) Add rvdiffto parameter to prop=revisions
* Add $wgAPIMaxUncachedDiffs (default 1) which controls how many non-cached diffs will be served per request
* Tweak DifferenceEngine.php a bit to make cache status accessible, and remove a useless 'parseinline' which broke diff generation in the API
2009-02-28 13:25:21 +00:00
Roan Kattouw
99c28aae22 API: Fix autolinker bug reported by DannyB on IRC: > was included in the URL 2009-02-27 19:36:34 +00:00
Roan Kattouw
88f35cdf6e API: Some cleanup
* Aggressively intval() numeric things; addresses the concerns raised on bug 11633
* Use ApiQueryBase::addTitleInfo() everywhere
* Remove a drug-induced-looking line from ApiQueryWatchlist.php
2009-02-27 16:03:01 +00:00
Roan Kattouw
a4b89293d6 API: (bug 17703) Fix regression from r47039 causing error code and error text to be switched for some errors. r47039 was backported to the 1.14 branch, will backport this one too. 2009-02-27 14:28:12 +00:00
Roan Kattouw
88075a3178 API: (bug 17673) Using &exportnowrap without &export results in an internal error 2009-02-26 10:11:53 +00:00
Roan Kattouw
1ca568692f Slight fix for r47781: remove useless if($index) conditional: $index is always set and non-false 2009-02-25 14:42:31 +00:00
Aaron Schulz
f0566ab4b6 INDEX use fixes 2009-02-25 04:33:44 +00:00
Roan Kattouw
decfd47c11 API: (bug 17626) Added uiprop=email to meta=userinfo 2009-02-23 13:34:29 +00:00
Roan Kattouw
9a7d4c9795 API: Fix up r47470: User::newFromRow() needs all rows from the User table. This kills lots of warnings and really fixes bug 17561 2009-02-21 12:44:41 +00:00
Roan Kattouw
7b631ca58d API: Add a STRAIGHT_JOIN to list=logevents on Domas's request. Also make an implicit JOIN explicit so the LEFT JOIN still goes against the right table 2009-02-20 21:18:07 +00:00
Roan Kattouw
b2503c70ab API: (bug 17563) Fix regression from r46845 that changed the output for list=backlinks to use page IDs as array indexes instead of 0,1,2,... (which makes a big difference in JSON and breaks clients) and caused weird output for generator=backlinks as well. Patch by Brad Jorsch 2009-02-19 21:24:28 +00:00
Roan Kattouw
02e968c1c8 API: (bug 17561) Recommit r44231 ("Added usprop=emailable to list=users"), which was accidentally undone by r46845 2009-02-18 22:31:46 +00:00
Roan Kattouw
48ae7ab6ff * API: (bug 17529) rvend ignored when rvstartid is specified
* To fix this, make the prop=revisions query slightly less performance-zealous and allow WHERE rev_timestamp <= 'foo' when sorting and rangescanning by rev_id
* Make adding ORDER BY in ApiQueryBase::addWhereRange() optional
* Move a RELEASE-NOTES entry to the right section
2009-02-18 15:26:09 +00:00
Tim Starling
7fa617fcfd Proposed fix for bug 17552. Also the name of the function should be changed, because there's nothing internal about it. 2009-02-18 12:41:28 +00:00
Tim Starling
dc40106960 Don't give a warning if there are no files in the page set. 2009-02-18 06:04:09 +00:00
Andrew Garrett
f629ef2584 Fix logic error from bad casing 2009-02-18 05:29:11 +00:00
Roan Kattouw
360f217786 API: Add AS explicitly for PostgreSQL compatibility and fix hinky indentation in ApiQueryUsers. Patch by Brad Jorsch 2009-02-16 19:08:07 +00:00
Roan Kattouw
036351d362 API: Fix yet another regression from r46845 that completely broke list=users. Patch by Brad Jorsch 2009-02-16 17:47:54 +00:00
Roan Kattouw
8c813c3c92 Redo r47313 in a more readable way (probably more efficient too) by not using all those array_* functions 2009-02-16 12:19:29 +00:00
Roan Kattouw
37070d2e5a API: (bug 17502) meta=siteinfo&siprop=namespacealiases no longer lists namespace aliases already listed in siprop=namespaces 2009-02-16 11:20:58 +00:00
Roan Kattouw
e0542e1cf9 API: Make information about the main module (ApiMain) and the pageset module (ApiPageSet) available through action=paraminfo 2009-02-14 14:56:20 +00:00
Roan Kattouw
075e96b9c8 Document ptlevel parameter. I should really learn to get stuff right in fewer than 5 commits 2009-02-13 21:53:08 +00:00
Roan Kattouw
92102dfb3e And yet another fixup for r47231: use older/newer rather than ascending/descending 2009-02-13 21:49:01 +00:00
Roan Kattouw
df08e87bcd ...and remove another allpages leftover *sigh* 2009-02-13 21:37:17 +00:00
Roan Kattouw
e731df02b6 Fix leftover doc comment in ApiQueryProtectedTitles 2009-02-13 21:36:34 +00:00
Roan Kattouw
8fc08c1869 API: (bug 16740) Adding list=protectedtitles to list create-protected titles 2009-02-13 21:34:46 +00:00
Roan Kattouw
c9c570e4a7 * API: Page prop=info by (ns, title) rather than offset
* Also fix a regression from r47214 which caused database errors when $this->titles or $this->missing was empty
2009-02-13 15:36:32 +00:00
Roan Kattouw
1ff24603a9 API: Fix up r47214, which strangely had no commit message
* Use + instead of array_merge(), the latter messes up keys
* Fix a fatal error ($result not an object)
* Fix an interesting mistake when calling addTables(): addTables('foo', 'bar') doesn't add both tables, but adds foo AS bar
* Fix warning about $row->pt_namespace not being set

Commit message for r47214:
API: Refactor ApiQueryInfo
* Move result generating code from execute() to extractPageInfo()
** Merge code for existing and missing titles
* Don't loop over existing and missing titles separately, but on both in one go
* Move protection query code from execute() to getProtectionInfo()
** Merge code for existing and missing titles here as well
* Move subjectid/talkid query code from execute() to getTSIDs()
* Document some functions
2009-02-13 15:14:21 +00:00
Roan Kattouw
c426593d8a 2009-02-13 14:44:19 +00:00
Roan Kattouw
7526c937c7 API: More docs, break long lines in docs 2009-02-13 14:13:03 +00:00
Roan Kattouw
6f1f506675 API: Prevent ApiQueryInfo from trying to set a continue value twice (which will fail with a fatal error) 2009-02-12 17:29:17 +00:00
Roan Kattouw
f0c3eaf444 API: Fix up r47142: use a boolean parameter for suggest 2009-02-12 17:27:05 +00:00
Roan Kattouw
2755b38a45 API: Remove stray $options = array(); from ApiPageSet
Previous commit message didn't mention changing ApiQueryInfo to sort $titles by page ID and to add info about missing pages in one go (the latter upon Brad Jorsch's suggestion)
2009-02-11 19:28:07 +00:00
Roan Kattouw
fdb926bca4 * API: Add documentation to important API classes
* Move page_is_redirect up in ApiPageSet::getPageTableFields()
2009-02-11 19:25:25 +00:00
Aaron Schulz
0b28c717b2 Add suggest=1 to search suggestion AJAX request. ApiOpenSearch won't execute such request if $wgEnableMWSuggest is disabled 2009-02-11 15:56:53 +00:00
Roan Kattouw
f825c7ba23 API: Page prop=imageinfo by (title, timestamp) rather than using an offset. Suggested by Brad Jorsch. 2009-02-10 19:10:58 +00:00
Roan Kattouw
2293460cbf API: (bug 17433) Added bot flag to list=watchlist&wlprop=flags output 2009-02-10 16:01:50 +00:00
Roan Kattouw
f6307768aa API: Make UTF-8 cleanup actually work; it was broken from the beginning. Apparently I expected array_walk to behave like array_map, which is not the case. 2009-02-10 15:56:34 +00:00
Roan Kattouw
6145465e34 API: Page prop=revisions by rev_id or (rev_page, rev_id), depending on mode, because the offset system potentially sucks. Suggested by Brad Jorsch 2009-02-10 12:32:22 +00:00
Roan Kattouw
4e573ef087 API: Query-continue prop=categoryinfo by cat_title rather than offset. Suggested by Brad Jorsch 2009-02-09 19:54:25 +00:00
Roan Kattouw
9024971911 Fix up r47037, which was itself a fix-up of r46845. Change suggested by Brad Jorsch 2009-02-09 19:24:28 +00:00
Roan Kattouw
40b6193c06 Remove a TODO from ApiMove and add a FIXME to SpecialMovepage 2009-02-09 15:15:49 +00:00
Roan Kattouw
81bf8d0a3a * API: (bug 17357) Add subpage moving to the API
* Added Title::moveSubpages() as a backend function
** Didn't update SpecialMovepage to use this; left to braver souls
* Fix handling of errors on talk page move (will backport)
2009-02-09 14:16:51 +00:00
Roan Kattouw
5f0226fd8d API: Fix up r46825:
* put the tables in the right order
* JOIN on user_text as well for better index usage
* Force the index on the recentchanges table as well
* Don't ORDER BY rev_user_text if it's constant
2009-02-09 14:07:18 +00:00
Roan Kattouw
4e67c4bdee Fix some more regressions from r46845 reported by Brad Jorsch on the mediawiki-api list <http://lists.wikimedia.org/pipermail/mediawiki-api/2009-February/000924.html> 2009-02-09 13:28:12 +00:00
Aaron Schulz
48993f18f9 Hide title if DELETED_ACTION is on, but don't worry about type/action, which isn't what we're worried about 2009-02-06 14:42:50 +00:00
Roan Kattouw
c07397ee7f Fix fatal error in r46885 (add templates parameter to action=import): add missing comma 2009-02-06 10:25:51 +00:00
Chad Horohoe
dc6c95a6f9 Add r46884 (Import templates via interwiki) to API as well. 2009-02-06 00:21:06 +00:00
Roan Kattouw
4018f00fb4 Fix regression from r46845 which broke ApiResult::cleanUpUTF8() and caused an E_NOTICE 2009-02-05 15:46:30 +00:00
Roan Kattouw
84624f39b5 Fix E_WARNING reported by siebrand 2009-02-05 15:31:06 +00:00
Roan Kattouw
2df33ff098 * API: BREAKING CHANGE: (bug 11430) Return fewer results than the limit in some cases to prevent running out of memory
* This means queries could possibly return fewer results than the limit and still set a query-continue
* Add iicontinue, rvcontinue, cicontinue, incontinue, amfrom to faciliate query-continue for these modules
* Implemented by blocking additions to the ApiResult object if they would make it too large
** Important things like query-continue values and warnings are exempt from this check
** RSS feeds and exported XML are also exempted (size-checking them would be too messy)
** Result size is checked against $wgAPIMaxResultSize, which defaults to 8 MB

For those who really care, per-file details follow:

ApiResult.php:
* Introduced ApiResult::$mSize which keeps track of the result size.
* Introduced ApiResult::size() which calculates an array's size
  (which is the sum of the strlen()s of its elements).
* ApiResult::addValue() now checks that the result size stays below
  $wgAPIMaxResultSize. If the item won't fit, it won't be added and addValue()
  will return false. Callers should check the return value and set a
  query-continue if it's false.
* Closed the back door that is ApiResult::getData(): callers can't manipulate
  the data array directly anymore so they can't bypass the result size limit.
* Added ApiResult::setIndexedTagName_internal() which will call
  setIndexedTagName() on an array already in the result. This is needed for the
  'new' order of adding results, which means addValue()ing one result at a time
  until you hit the limit or run out, then calling this function to set the tag
  name.
* Added ApiResult::disableSizeCheck() and enableSizeCheck() which disable and
  enable size checking in addValue(). This is used for stuff like query-continue
  elements and warnings which shouldn't count towards the result size.
* Added ApiResult::unsetValue() which removes an element from the result and
  decreases $mSize.

ApiBase.php:
* Like ApiResult::getData(), ApiBase::getResultData() no longer returns a
  reference.
* Use ApiResult::disableSizeCheck() in ApiBase::setWarning()

ApiQueryBase.php:
* Added ApiQueryBase::addPageSubItem(), which adds page subitems one item
  at a time.
* addPageSubItem() and addPageSubItems() now return whether the subitem
  fit in the result.
* Use ApiResult::disableSizeCheck() in setContinueEnumParameter()

ApiMain.php:
* Use ApiResult::disableSizeCheck() in ApiMain::substituteResultWithError()
* Use getParameter() rather than $mRequest to obtain requestid

DefaultSettings.php:
* Added $wgAPIMaxResultSize, with a default value of 8 MB

ApiQuery*.php:
* Added results one at a time, and set a query-continue if the result is full.

ApiQueryLangLinks.php and friends:
* Migrated from addPageSubItems() to addPageSubItem(). This eliminates the
  need for $lastId.

ApiQueryAllLinks.php, ApiQueryWatchlist.php, ApiQueryAllimages.php, ApiQuerySearch.php:
* Renamed $data to something more appropriate ($pageids, $ids or $titles)

ApiQuerySiteinfo.php:
* Abuse siprop as a query-continue parameter and set it to all props that
  couldn't be processed.

ApiQueryRandom.php:
* Doesn't do continuations, because the result is supposed to be random.
* Be smart enough to not run the second query if the results of the first
  didn't fit.

ApiQueryImageInfo.php, ApiQueryRevisions.php, ApiQueryCategoryInfo.php, ApiQueryInfo.php:
* Added continue parameter which basically skips the first so many items

ApiQueryBacklinks.php:
* Throw the result in a big array first and addValue() that one element at a time if necessary
** This is necessary because the results aren't retrieved in order
* Introduced $this->pageMap to map namespace and title to page ID
* Rewritten extractRowInfo() and extractRedirRowInfo() a little
* Declared all private member variables explicitly

ApiQueryDeletedrevs.php:
* Use a pagemap just like in Backlinks
* Introduce fake page IDs and keep track of them so we know where to add what
** This doesn't change the output format, because the fake page IDs start at 0 and are consecutive

ApiQueryAllmessages.php:
* Add amfrom to facilitate query-continue

ApiQueryUsers.php:
* Rewrite: put the getOtherUsersInfo() code in execute()
2009-02-05 14:30:59 +00:00
Roan Kattouw
167d11a8c3 * API: Listing (semi-)deleted revisions and log entries (with rev_/log_deleted != 0) as well in prop=revisions and list=logevents, with commenthidden/userhidden/actionhidden/texthidden flags where appropriate
* Still honors the paranoia checks added in r46807
* Use $index consistently in ApiQueryLogEvents
* Some whitespace consistency
2009-02-05 11:44:10 +00:00
Roan Kattouw
3a259992fb API: Re-enable ucprop=patrolled and rcshow=patrolled|!patrolled using the timestamp index for the join (thanks to Tim for pointing this out) and a STRAIGHT_JOIN for the inner join case 2009-02-04 23:19:18 +00:00
Roan Kattouw
ff45244744 API: BREAKING CHANGE: Remove rctitles parameter from list=recentchanges for performance reasons (requests using it time out on enwiki) 2009-02-04 22:51:36 +00:00
Roan Kattouw
18eb32ec29 API: Tweak the format for &export to be more XML-friendly. Not a breaking change since &export hasn't gone live yet anyway 2009-02-04 22:12:25 +00:00
Roan Kattouw
bb3980dd8d * API: (bug 17007) Add action=import
* Add intoken=import to prop=info
* Store message key and arguments in WikiErrorMsg
2009-02-04 20:11:27 +00:00
Roan Kattouw
b677d0191d * API: (bug 17355) Added auwitheditsonly parameter to list=allusers
* Use consistent code style
2009-02-04 19:10:14 +00:00
Roan Kattouw
6f11c2331b Nitpicking brigade: fix copyright year 2009-02-04 14:18:53 +00:00
Roan Kattouw
f68b0a79c1 API: Temporarily disable ucprop=patrolled and ucshow=patrolled|!patrolled because of performance concerns mentioned on bug 17215 2009-02-04 13:16:12 +00:00
Roan Kattouw
bb81750f27 * API: (bug 17326) BREAKING CHANGE: Changing output format for prop=imageinfo&iiprop=metadata to something based on name/value pairs. This means we don't use parts of the metadata in attributes anymore, something that caused invalid XML to be output. For more info on the exact format, see the mediawiki-api mailing list
* Removed the spaces-to-underscores hack in the XML formatter
2009-02-03 16:25:50 +00:00
Roan Kattouw
2b6314c9c4 (bug 17327) Normalize API help texts: remove quotes 2009-02-02 23:17:07 +00:00
Roan Kattouw
5e5684ec77 * API: (bug 17007) Add export functionality to the API
* Accessed through the export and exportnowrap parameters added to action=query
* To facilitate &exportnowrap, add ApiFormatRaw, a formatter that just spits out its input without any formatting (not accessible through &format= of course)
* Fix up the action=query description message to reflect the deprecation of query.php
2009-02-02 20:07:33 +00:00
Roan Kattouw
a2974f51f1 API: (bug 17317) Added watch parameter to action=protect 2009-02-02 16:38:40 +00:00
Roan Kattouw
20fec70243 Fix up r46646: instead of outputting displaytitle="" when {{DISPLAYTITLE}} isn't used (or isn't valid), output the 'normal' title instead 2009-01-31 16:35:23 +00:00
Roan Kattouw
82b34d1b03 API: (bug 17239) Added prop=displaytitle to action=parse 2009-01-31 16:29:15 +00:00
Roan Kattouw
06b5d0f9d5 API: (bug 17224) Add siprop=rightsinfo to meta=siteinfo. Modified patch by Brianna Laugher 2009-01-31 15:56:52 +00:00
Roan Kattouw
8e361227a2 Revert r46512 (Add "check" parameter to action=email) and its followups r46515 and r46517. This functionality is already present in list=users (as usprop=emailable), where it belongs 2009-01-31 13:20:36 +00:00
Roan Kattouw
2e6fb0623e API: (bug 17182) Fix pretty printer so URLs with parentheses in them are autolinked correctly 2009-01-31 13:05:12 +00:00
Roan Kattouw
7babbd2fc5 Add the 'movenotallowedfile' message to the API message map. Turns out that's all I needed to do to support file moving through the API :D 2009-01-29 23:01:13 +00:00
Bryan Tong Minh
57d7e2bb88 Also return why the target user is not valid 2009-01-29 19:30:18 +00:00
Bryan Tong Minh
7058f802a2 Kill code duplication & other style tweaks 2009-01-29 19:27:44 +00:00
X!
73ba55efd6 Forgot to remove that 2009-01-29 04:13:50 +00:00
X!
38299137f7 Per 46512#c1554, moving check to before required params, returns a result rather than an error, and it must be posted. 2009-01-29 03:23:25 +00:00
X!
a9b78e1db9 Add "check" parameter to action=email 2009-01-29 01:25:17 +00:00
Andrew Garrett
0fcc017391 Fix broken calls to ArticleDelete hook. 2009-01-29 01:04:00 +00:00
Brion Vibber
79d0c8e34b Pulling back r46341 and r46342 for now "API: (bug 17142) Add redirects parameter to action=opensearch to control redirect resolution. Changes to OpenSearchXML extension in next commit"
Mysteriously there's no way to get a boolean parameter to default to true, which leads to an incompatibility in the sensible behavior of the more detailed responses in the XML output -- eg you get a whole buttload of "#REDIRECT Blabla" in your results, which is absolutely hideous. This is very much not desireable. :)
If we could change the default, and allow it to be set on or off for specific requests if some person for some reason is doing highly customized suggestion searches and wants it configured differently (no idea why), that might be doable. But as written this doesn't make any sense.
2009-01-27 20:39:24 +00:00
Roan Kattouw
41cc3f6271 API: (bug 17142) Add redirects parameter to action=opensearch to control redirect resolution. Changes to OpenSearchXML extension in next commit 2009-01-27 14:43:06 +00:00
Roan Kattouw
383d826b0f Revert r46138 (Get $wgLegalTitleChars through API) per comments on CodeReview and Bugzilla (bug 17024) 2009-01-27 13:10:16 +00:00
Roan Kattouw
6449867508 * API: (bug 15949) Add undo functionality to action=edit
* Move undo text generation from EditPage::getContent() to Article::getUndoText()
* Add some more examples for action=edit
* ApiEditPage.php: don't mix !is_null() and isset(), be consistent
2009-01-26 13:51:03 +00:00
Roan Kattouw
2e5e8808b4 API: (bug 17024) Added legaltitlechars field to meta=siteinfo&siprop=general output, which contains the value of $wgLegalTitleChars 2009-01-24 13:16:24 +00:00
Roan Kattouw
37ebf53907 Explain why this code doesn't use LinkBatch. 2009-01-24 13:10:30 +00:00
Roan Kattouw
32042c271f API: (bug 16483) Kill filesort in ApiQueryBacklinks caused by missing parentheses. Building query properly now using makeList() 2009-01-24 13:00:43 +00:00
Roan Kattouw
cd910c6544 API: Fix profiling errors caused by calling wfProfileClose() from dieUsage() 2009-01-23 20:23:34 +00:00
Roan Kattouw
4b20f8cc75 API: ApiBase::dieUsage() is not a static function, fix static calls 2009-01-23 20:08:00 +00:00
Roan Kattouw
ad4a03c316 Fix up r45749: do is_string() check in the caller instead 2009-01-21 09:26:48 +00:00
Roan Kattouw
b9669c44fe Followup to r45954: it helps to save before committing 2009-01-21 09:22:48 +00:00
Roan Kattouw
6f960e39e1 Fix indentation for r45944 and use consistent code style 2009-01-21 09:21:58 +00:00
Chad Horohoe
36a2416694 Code style tweak. 2009-01-20 23:58:18 +00:00
Alex Z
ff00dda0d0 Make API action=delete respect $wgDeleteRevisionsLimit 2009-01-20 23:37:39 +00:00
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