mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 21:53:35 +00:00
SECURITY: Use an anonymous user as creator for autocreations
This is saner, and allows consequences such as blocks to go through. Bug: T272244 Change-Id: Ie1f4333d5b1c9d17fb2236fe38a31de427a4cc48
This commit is contained in:
parent
6d2cf467fc
commit
ddb06aa783
|
@ -29,14 +29,15 @@ class AbuseFilterPreAuthenticationProvider extends AbstractPreAuthenticationProv
|
|||
public function testUserForCreation( $user, $autocreate, array $options = [] ) {
|
||||
// if this is not an autocreation, testForAccountCreation already handled it
|
||||
if ( $autocreate ) {
|
||||
return $this->testUser( $user, $user, true );
|
||||
// FIXME Using the constructor directly here a bit hacky but needed for T272244
|
||||
return $this->testUser( $user, new User, true );
|
||||
}
|
||||
return StatusValue::newGood();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user The user being created or autocreated
|
||||
* @param User $creator The user who caused $user to be created (or $user itself on autocreation)
|
||||
* @param User $creator The user who caused $user to be created (can be anonymous)
|
||||
* @param bool $autocreate Is this an autocreation?
|
||||
* @return StatusValue
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue