Commit graph

1872 commits

Author SHA1 Message Date
Sam Reed
a6569e0294 * (bug 28586) YAML: strings that are the same as boolean literals
* (bug 28591) Update/replace/supplement spyc (YAML parsing library)
* YAML API output is now 1.2 compliant, using JSON as the formatter

YAML 1.2 spec is a JSON subset - "The primary objective of this revision is to bring YAML into compliance with JSON as an official subset. YAML 1.2 is compatible with 1.1 for most practical applications - this is a minor revision." [1] Per discussion with Tim, switch YAML to use the JSON formatter

Was originally going to delete the ApiFormatYaml per Tim, but class needed to keep nicer (and apparent) output in API help page

Hence made subclass ApiFormatJson, minimal method overriding

spyc.php deleted from libs

[1] http://www.yaml.org/spec/1.2/spec.html#id2803629
2011-04-18 11:42:44 +00:00
Happy-melon
400357e90a Follow-up r85929: update MediaWiki::articleFromTitle() calls in extensions (and a few edgecases which were missed in core) 2011-04-17 19:25:30 +00:00
Roan Kattouw
8cc843f25c API: BREAKING CHANGE: (bug 28541) Output of binary ICU sortkeys is broken. Change sortkey fields in prop=categories and list=categorymembers to hexadecimal strings, that way we don't have any issues with scary binary stuff. Also change cmcontinue to take hex-encoded sortkeys and swap the order back to normal (previously sortkey was at the end because it could contain pipe characters, but that's not an issue with hex). 2011-04-17 12:41:29 +00:00
Happy-melon
2c9cfd7cce Refactor the factory/i18n/list/etc static methods from SpecialPage into their own class; there's no reason we need to be parsing them in every single SpecialPage subclass. Leave all the methods as stubs in SpecialPage.php; if we required PHP 5.3 they could be replaced by a a __callStatic() magic method, but that doesn't work on PHP 5.2.
Also make a few changes to the functions available.  SpecialPageFactory::resolveAlias() now takes an optional subpage and returns array(<name>,<subpage>).  Similarly merge getPage() and getPageByAlias().  There were many examples of (extensions particularly) making dubious assumptions about the presence or absence of subpages or canonical-ness.

I didn't deprecate SpecialPage::getTitleFor() as it's got over six hundred calls.  I'm rather undecided on the best position of getPage()/executePath().  Although the latter needs cleanup anyway.
2011-04-17 11:31:11 +00:00
Brian Wolff
74f16767e7 Merge to trunk everything in img_metadata branch.
Hope I did this in an ok fashion. svn merge --re-integrate was giving me issues
so I just essentially over-wrote my working copy with the version at img_metadata.
2011-04-16 01:23:15 +00:00
Bryan Tong Minh
e04879cf89 Follow-up r83302: Check permissions 2011-04-14 21:09:16 +00:00
Happy-melon
8779f4b55f r86001, now with less scariness :P I took out the delete action and did purge instead, which is a much more self-contained action-with-a-form. Also implement a few changes suggested by Brion on IRC last night. 2011-04-14 10:38:29 +00:00
Happy-melon
bc4a096805 Revert r86001: Brion says it's too scary :D will recommit in pieces 2011-04-13 23:36:27 +00:00
Happy-melon
6dc8136d12 New infrastructure for actions, as discussed on wikitech-l. Fairly huge commit.
* Actions come in two flavours: the show-a-form-then-do-something-with-the-result (delete, protect, edit, etc) and the just-do-something (watch, rollback, patrol, etc).  Create abstract base classes Action and FormlessAction to support these two cases.  HTMLForm is an integral part of the form-based structure.
* Look mum, no globals!  :D  Fully context-based.
* Implement watch/unwatch, credits and delete actions in the new system as proof-of-concept.  This also gives the delete frontend a much-needed overhaul.
* Stub out the newly-deprecated functions from Article.php.  This already reduces its linecount by about 15%, and there are plenty more actions still to do.
* Centralising actions like this is going to render a lot of hooks type-incompatible.  There's simply nowhere you can put the ArticleConfirmDelete hook, for instance, where it can be passed an OutputPage as the second parameter.  On the other hand, we can implement new hooks like ActionModifyFormFields and ActionBeforeFormDisplay, which can do much prettier stuff to the forms, like adding extra fields the 'right' way.  Update LiquidThreads to use these new hooks where appropriate.
2011-04-13 23:04:07 +00:00
Sam Reed
12d7d7b90f * (bug 26873) API: Add 'toponly' filter in usercontribs module 2011-04-10 21:52:34 +00:00
Sam Reed
00b3434d47 * (bug 28455) Add 'toponly' to recentchanges API module 2011-04-10 21:42:20 +00:00
Sam Reed
f502988282 * (bug 27712) add parent_id to list=deletedrevs 2011-04-10 21:11:39 +00:00
Sam Reed
af3a1052ff * (bug 28254) action=paraminfo: Extract type from PARAM_DFLT if PARAM_TYPE is not set
Patch by Umherirrender
2011-04-10 13:01:47 +00:00
Sam Reed
00f0594736 * (bug 28364) add registration date to meta=userinfo 2011-04-10 12:27:32 +00:00
Sam Reed
09ea8906a2 * (bug 28368) add hint for multipart/form-data to api information of action=import&xml=
Add RELEASE-NOTES for r85585 too
2011-04-10 12:15:03 +00:00
Aaron Schulz
50df1d4794 Quick fix to categoriesHtml() given new skin changes 2011-04-10 06:46:02 +00:00
Paul Copperman
f7e6dfb4a3 Various fixes for PHPUnit tests:
* Block.php: Set mExpiry to the value we store in the database, so that Block::equals() returns true. Fixes BlockTest::testInitializerFunctionsReturnCorrectBlock.
* In Title::checkUserBlock(): Convert message parameters to plain strings to make strict comparisons work. Fixes TitlePermissionTest::testUserBlock().
* ApiBlock.php: Follow-Up r85166, add 'Confirm' parameter to data array. Fixes ApiBlockTest::testMakeNormalBlock().
* ApiQueryTest.php: Use $wgMetaNamespace instead of $wgSitename	to account for customizations.
* RandomImageGenerator.php: Use default value for constructor param to prevent fatals.
* ApiTestCaseUpload.php: 
** Fix undefined variable $fileName.
** Remove stray ini_set statements, they don't belong there. Especially ini_set( 'error_reporting', 1 ) will effectively disable all reporting, which makes errors hard to track.
* ArticleTablesTest.php: Put testbug14404() in group Broken, as the fix for the bug has been reverted in r83868.
2011-04-07 14:54:38 +00:00
Brion Vibber
b0497da1fc * (bug 28368) add hint for multipart/form-data to api information of action=import&xml= 2011-04-06 22:16:38 +00:00
Alexandre Emsenhuber
7fc4255afe Seems I forgot this file in r85442 2011-04-05 16:28:38 +00:00
Happy-melon
625695317e Follow-up r85302: update OutputPage constructors in core. 2011-04-05 00:06:47 +00:00
Sam Reed
ea056f5171 Fixup a few undefined variables and alike while checking REL1_17 2011-04-04 21:13:34 +00:00
Krinkle
d3eec98cb7 Set forgotten api parameters types
* (bug 28394) Set forgotten parameters types in ApiUnblock
* (bug 28395) Set forgotten parameters types in ApiParse
2011-04-04 20:51:41 +00:00
Daniel Friesen
86583c7c8f Start better utalizing OutputPage as the focal point for things related to the output of the page. Like getTitle use $out->get{User,Skin} instead of $wgUser and $wgUser->getSkin() for things where the user or skin is being used for output generation back to $out instead of using globals with bad structure. 2011-04-03 03:59:47 +00:00
Bryan Tong Minh
100ecff40e Get the thumbmime from the handler instead of guessing it with UnregisteredLocalFile. 2011-04-02 14:49:12 +00:00
Sam Reed
f373e63255 Followup r84825
Allow obtaining of an import token if users have the importupload right
2011-04-01 17:29:15 +00:00
Roan Kattouw
f212ddabae BREAKING CHANGE: Ignore cmtype when cmsort=timestamp is set, and bypass the per-type queries in the sort=timestamp case; they were causing performance problems, reported as bug 28291. This breaks backwards compatibility (gracefully, the cltype parameter is silently ignored) with earlier deployed versions of 1.17wmf1 but not with any released version, hence no RELEASE-NOTES 2011-03-28 15:01:20 +00:00
Daniel Friesen
c49946aa39 Followup r79433, hide realname from output when realnames are a hidden pref. 2011-03-28 03:25:36 +00:00
Sam Reed
6f13020e33 * (bug 28263) cannot import xml with the api, when have not "import" user right, but "importupload"
Normalised api user right checking to that of SpecialImport, by moving permission checks into specified code paths


Some documentation and explicit variables added while inspecting other code
2011-03-27 01:14:57 +00:00
Sam Reed
f5c7c7d735 * (bug 28249) allow dupes in meta=allmessages&amargs 2011-03-26 18:52:07 +00:00
Sam Reed
d48986abc5 Followup r84356, don't pass title string, pass a title object 2011-03-26 18:46:15 +00:00
Sam Reed
76a4e7d4ce Followup r84363
Looks like I made a complete hash of that commit. Commit correct version from vm working copy
2011-03-26 18:39:22 +00:00
Bryan Tong Minh
8bd336981c API upload errors may now return the parameter that needs to be changed and a sessionkey to fix the error. This is for now only done for uploads that can be fixed by changing the filename, but may be extended later to comment and pagetext. 2011-03-25 21:22:02 +00:00
Bryan Tong Minh
ebb8b7447d (bug 28070) Fix watchlist RSS for databases that store timestamps in a real timestamp field by using Database::timestamp(). Tested by Dan Nessett on 1.16. Not tested on trunk, but no reason why it should not work. 2011-03-25 21:05:43 +00:00
Neil Kandalgaonkar
331406bf46 don't check title permissions if upload is destined for stash anyway 2011-03-25 20:42:05 +00:00
Neil Kandalgaonkar
43cf8e6d6e change the name of UploadBase::verifyPermissions() to verifyTitlePermissions() for clarity. A wrapper function is left for extensions that rely on the old method 2011-03-25 20:37:26 +00:00
Sam Reed
230b6a2f51 Followup r84698, remove unused $db 2011-03-25 10:37:56 +00:00
Sam Reed
f8e4915b9c Fix the last assignment in conditional, bit of code duplication, as the next isn't iterable :( 2011-03-25 10:36:07 +00:00
Platonides
b37e81b76b Use class name Html in canonical form.
Removed unused globals $wgHooks, $wgBlockAllowsUTEdit, $wgUser, $wgOut
$wgUser was already set global at function beginning.
Moved global out of switch
2011-03-24 21:35:14 +00:00
Sam Reed
74cfe3df00 Followup r79549, only try and filter by group (or right) if there are some groups to do a WHERE on 2011-03-24 20:27:30 +00:00
Sam Reed
f9c5d0d9bd * (bug 28226) prop=extlinks&eloffset should be an integer 2011-03-24 20:05:45 +00:00
Sam Reed
6d5cca465d Remove 2 erroneous $db parameters from External links modules 2011-03-24 20:02:41 +00:00
Sam Reed
e82ca13996 Don't pass $this by reference 2011-03-24 11:11:15 +00:00
Sam Reed
f326b59650 Remove some trailing whitespace
Add some documentation
2011-03-24 00:43:27 +00:00
Ryan Lane
2273857827 Removing pass by reference, and making the $error argument for doDeleteArticle a reference. Follow up for r84638. 2011-03-23 22:13:09 +00:00
Ryan Lane
308203304d Moving deletion hooks into doArticleDelete so that other code can sanely delete articles. Fixed other core code that was wrapping the calls with hook calls. 2011-03-23 21:54:59 +00:00
Sam Reed
280355d209 * (bug 27586) Remove duplication of props in ApiQueryStashImageInfo by using ApiQueryImageInfo
Programatically do properties and descriptions. Reduces text duplication, and hence normalises descriptions! :)

Follows up r84502, r84433
2011-03-22 00:08:45 +00:00
Sam Reed
9818053bd3 * (bug 27589) list=allimages&aiprop=archivename is useless
Followup r84433

Add way to filter returned properties/descriptions
2011-03-21 23:51:26 +00:00
Happy-melon
6dbcdc1be0 Blame hashar for this giant commit; he teased me for making so many smaller ones earlier... :D
* Internalise $mAddress/$mUser, $mBy/$mByName, $mEnableAutoblock, $mId as getTarget(), getBlockers(), isAutoblocking(), getId().  
* This required editing AbuseFilter and CheckUser backwards-incompatibly, so push the rest of the changes out to those extensions.
* Attack the evil 14-parameter constructor and gratuitously-confusing newFromDB( $notVeryImportantParameter, $moreImportantParameter)
* Reimplement the hack for bug 13611 in a slightly less fragile fashion; could still do with further cleanup, but then again the login frontend is its own can of worms... :S
* Remove transitionary getTargetAndType() and newFromTargetAndType() methods
* Some optimisation in parseTarget()
* Fix the broken phpunit test mentioned in r84251
2011-03-21 19:12:41 +00:00
Sam Reed
db3698860a Start of bug 27586/bug 27589
Turn properties into a filterable key/value pair, but leave exisiting wrapper methods in place for the moment

Will finish it off later
2011-03-20 23:50:59 +00:00
Sam Reed
cf023d04dc As I've removed most of Roans reason to use php magic variables, completely remove them this time.
Followup r84430
2011-03-20 22:46:09 +00:00