Commit graph

205 commits

Author SHA1 Message Date
Sam Reed
e1d83d5721 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:54 +00:00
Sam Reed
85ee2d2db2 * (bug 33101) Viewing a User or User talk of username resembling IP ending with .xxx causes Internal error
Patch by Brad Jorsch

Also simplify double return null in method
2011-12-15 18:57:53 +00:00
Jeroen De Dauw
49cdca93be add missing deprecation notices and added deprecation version to existing ones 2011-12-13 05:19:05 +00:00
Sam Reed
ec9afed7ce Add a getExpiry method to Block (rather than direct member variable access. Yuck) 2011-12-06 15:23:21 +00:00
Jure Kajzer
69e66bdfe9 * reverted changes to Block and ApiBlockTest made in r102625 ... PEBKAC 2011-11-10 09:36:18 +00:00
Jure Kajzer
be3bbfc539 * Added getInfinity to DatabaseOracle
* Block - replaced 'infinity' strings with DB->getInfinity calls
* UploadStash - added sequence value generation for ID
2011-11-10 07:41:12 +00:00
Jure Kajzer
d9b00fc155 * fixed ipblocks.ipb_by_text field, removed default blank not null (fixed install&update)
* fixed Block->insert; ipblocks.ipb_id is autoincrement field (should use sequences for compatibility)
2011-11-04 11:35:10 +00:00
Aaron Schulz
7916d730ae (bug 31739) Made Block code support ipb_by = 0 convention with for foreign users again, as it did pre 1.18. The byText param has been restored in the Block() constructor as CentralAuth still uses it. Some callers have been updated to reflect the fact that getBlocker() may be a local User or a string username.
Ideally, we might have a ForeignUser class and a generic User interface...but this will do for now.
2011-11-01 00:11:53 +00:00
Sam Reed
9d41b95053 Kill various unused variables
Comment some out also

Add some bits of documentation
2011-10-29 01:17:26 +00:00
Sam Reed
27665d27ae Update some deprecated code
Documentation

Fix "/*" comments to "/**"

Flesh out some missing returns, change some return types
2011-10-14 21:18:38 +00:00
Robin Pepermans
894bdaabe4 Fix r91886 thanks to johnduhart: check if it is an IP *before* stripping subpages, otherwise IP range blocking does not work 2011-08-12 14:32:05 +00:00
Rotem Liss
1d2e8d29ef Fixing comment (no Language::decodeExpiry). 2011-08-02 11:47:36 +00:00
Sam Reed
fcebee405f Add comment
Remove unused wfGetDb()
2011-07-18 22:23:42 +00:00
Andrew Garrett
4b12070e70 Fix autoblocks in r92480 r92482 -- modified the wrong half 2011-07-18 22:02:11 +00:00
Andrew Garrett
db9832ae98 Fix autoblocks in r92480 2011-07-18 21:56:59 +00:00
Andrew Garrett
365bf2cfc3 Block.php fixes: Always store mExpiry as a TS_MW or "infinity". Convert as appropriate. 2011-07-18 21:48:56 +00:00
Aaron Schulz
4a1b848c58 Follow-up r92220: changed autoblock handling to use PerformRetroactiveAutoblock hook instead of a global. Also made CheckUser always override autoblocks (no config). 2011-07-15 00:48:02 +00:00
Aaron Schulz
02af8ad230 * Removed angry autoblock code - unused by anything
* Added $wgAutoblockHandlers variable for alternative autoblock handling functions
* Gave CheckUser a potential $wgAutoblockHandlers function (bug 29330)
2011-07-15 00:05:50 +00:00
Robin Pepermans
740b9aa49f (bug 29797) Error: "Tried to load block with invalid type" when subpages are disabled for user pages.
Patch by Jarry1250
2011-07-11 16:53:31 +00:00
Happy-melon
b99ab08b2a Follow-up r88738: this check is no longer needed since r88750. 2011-06-27 13:48:01 +00:00
Happy-melon
89b9bc984d Follow-up r84588 CR 2011-06-26 23:10:57 +00:00
Happy-melon
f26f0a13ae Follow-up r84475 CR; and also documentation fixes; PhpStorm 2.1 is *even more* fussy about documentation format... :D 2011-06-26 23:01:29 +00:00
Siebrand Mazeland
7779b72373 Reduce calls to wfTimestampNow() by using temporary variable. Inspired by CR on r88278. 2011-06-24 10:00:35 +00:00
Aaron Schulz
66894363d8 Tweaked comments and code in confusing spot of doAutoblock() 2011-06-18 00:29:32 +00:00
Brion Vibber
6286ac2971 Another partial fix for Block test: update $this->mId on successful Block::insert() 2011-06-15 20:42:16 +00:00
Brion Vibber
39259a36ec Fix for partial regression in r84534: Block::newFromId was no longer handling the case where there was no matching row correctly. Now returns null.
This bug was showing up in test results like this:

  BlockTest::testInitializerFunctionsReturnCorrectBlock
  Trying to get property of non-object
  
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/Block.php:340
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/Block.php:365
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/Block.php:118
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/BlockTest.php:60
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60

However, that only triggers because the actual test is failing -- it's expecting to get a return back. This can only be reproduce when using the suite.xml configuration file, and not when running the BlockTest standalone.
2011-06-15 19:05:25 +00:00
Chad Horohoe
e1d01b4d7b Fix (Api)BlockTest for Sqlite. getRangeStart()/getRangeEnd() were returning null for user blocks, which was then happily inserted into a NOT NULL column. The IGNORE was just masking the real error. Thanks Brion and MaxSem. Oh, and ping r84475 2011-06-07 18:13:21 +00:00
Mark A. Hershberger
a6722cc9aa w/s changes. 2011-06-02 19:32:45 +00:00
Sam Reed
4065e65d03 Even more documentation in various files 2011-05-29 14:24:27 +00:00
Sam Reed
2b676156ba And even more documentation 2011-05-28 18:58:51 +00:00
Brion Vibber
536fad8f90 * (bug 29116) Fix regression breaking CheckUser extension
Fixes regression from r84475 and friends which made Block->load() and its new front-end Block::newFromTarget() fail when an empty string was passed in as the IP / $vagueTarget parameter to indicate skipping IP-based lookups.
Added phpunit test cases to confirm that both Block->load() and Block::newFromTarget() work when given null (already ok), '' (as done from CheckUser), or false (not seen, but perfectly legit sounding).
Adjusted comparisons to work as expected.
2011-05-24 21:04:50 +00:00
Happy-melon
28105675da (bug 29116) follow-up r84475: normalise the empty string to null in Block::newFromTarget(). 2011-05-24 19:03:41 +00:00
Happy-melon
d91b0ed998 Follow-up r84475: Block::parseTarget() should always return an array. 2011-05-23 18:52:36 +00:00
Alexandre Emsenhuber
9536c97c00 DB_READ -> DB_SLAVE, the former is obsolete 2011-05-18 19:29:50 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Sam Reed
1d5b18a1a2 Revert r85776, r85782 pending better solution 2011-04-12 20:27:26 +00:00
Sam Reed
89a136bb46 Followup r85776, per Aaron, add documentation showing reason why explicit creation of a new LB was added 2011-04-11 12:48:59 +00:00
Sam Reed
0966401501 * (bug 28485) Block::purgeExpired Database returned error "1205: Lock wait timeout exceeded;"
Commit changes per Tims suggestion on the ubg
2011-04-11 00:29:42 +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
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
Happy-melon
12a29249ae Try to untangle the autoblock time logic, which made very little sense and led to very old indefinite blocks triggering autoblocks with ipb_expiry < ipb_timestamp. 2011-03-23 00:10:46 +00:00
Happy-melon
40a926ab2c (hopefully) last bit of heavy lifting in Block.php: now that we've internalised most of the variables, untangle their twisted connections to the database layer and remove various now-unused protected methods and variables. 2011-03-22 17:18:15 +00:00
Aaron Schulz
f6e0bc9324 Fixed daft error in r84523 so "angry" autoblocks work again 2011-03-22 11:51:09 +00:00
Happy-melon
a9016c40ff Don't try and load a block with no target; we're not going to find it :D 2011-03-22 11:45:18 +00:00
Aaron Schulz
bc6ec5e2ff Relate block log entries to block table rows (useful for bug 25763) 2011-03-22 11:22:15 +00:00
Happy-melon
271062e07e Follow-up r84475: what ever posessed me to get rid of this? 2011-03-21 23:27:08 +00:00
Happy-melon
cf08b61b1b Follow-up r84475: fixing the warning is easy enough... :D Also some random tweaks to Database.php documentation. 2011-03-21 23:03:11 +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
Happy-melon
b61f104042 Follow-up r84358 CR: rename 'editusertalk' to 'editownusertalk', private --> protected, and run stylize.php over Block.php 2011-03-20 17:43:17 +00:00
Happy-melon
7eac649e6d * Implement an extensible Block::prevents( <action> ) function to replace the plethora of direct member variable accesses This pushes the historic *disable*-createaccount-vs-*allow* usertalk-edit wierdness down to the database layer
* Implement accessors for isHardblock() and getRangeStart()/getRangeEnd() in the same fashion.
* Make the corresponding variables private, removing external accessors.  This required updating AbuseFilter with non-B/C code, so I also implemented the rest of the changes I've made to the blocking backend in that extension.
* Move the "get an IP range which encompasses the given IP/range" logic to Block.php; will be needed later... :D
2011-03-19 23:47:08 +00:00