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
This commit is contained in:
Happy-melon 2011-03-21 19:12:41 +00:00
parent 12e1428629
commit 9a2a9b919a

View file

@ -1007,12 +1007,9 @@ class AbuseFilter {
// Create a block.
$block = new Block;
$block->mAddress = $wgUser->getName();
$block->mUser = $wgUser->getId();
$block->mBy = $filterUser->getId();
$block->mByName = $filterUser->getName();
$block->setTarget( $wgUser->getName() );
$block->setBlocker( $filterUser );
$block->mReason = wfMsgForContent( 'abusefilter-blockreason', $rule_desc );
$block->mTimestamp = wfTimestampNow();
$block->isHardblock( false );
$block->prevents( 'createaccount', true );
$block->mExpiry = SpecialBlock::parseExpiryInput( $wgAbuseFilterBlockDuration );
@ -1046,12 +1043,9 @@ class AbuseFilter {
// Create a block.
$block = new Block;
$block->mAddress = $range;
$block->mUser = 0;
$block->mBy = $filterUser->getId();
$block->mByName = $filterUser->getName();
$block->setTarget( $range );
$block->setBlocker( $filterUser );
$block->mReason = wfMsgForContent( 'abusefilter-blockreason', $rule_desc );
$block->mTimestamp = wfTimestampNow();
$block->isHardblock( false );
$block->prevents( 'createaccount', true );
$block->mExpiry = SpecialBlock::parseExpiryInput( '1 week' );