mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-27 15:30:42 +00:00
SECURITY: Avoid database for MediaWiki:Abusefilter-blocker fallback
If the content language is English and the message is invalid as a username, or the content language is not English and both the content language version and the English version are invalid, the user in FilterUser would not be created - now, avoid the onwiki version of the English message in the fallback, so it could only be invalid if the default in the i18n files was invalid. Bug: T284364 Change-Id: I9e9f44b7663e810de70fb9ac7f6760f83dd4895b
This commit is contained in:
parent
2b1de9ef11
commit
71bf9faf49
|
@ -51,7 +51,11 @@ class FilterUser {
|
|||
);
|
||||
// Use the default name to avoid breaking other stuff. This should have no harm,
|
||||
// aside from blocks temporarily attributed to another user.
|
||||
$defaultName = $this->messageLocalizer->msg( 'abusefilter-blocker' )->inLanguage( 'en' )->text();
|
||||
// Don't use the database in case the English onwiki message is broken, T284364
|
||||
$defaultName = $this->messageLocalizer->msg( 'abusefilter-blocker' )
|
||||
->inLanguage( 'en' )
|
||||
->useDatabase( false )
|
||||
->text();
|
||||
$user = User::newSystemUser( $defaultName, [ 'steal' => true ] );
|
||||
}
|
||||
'@phan-var User $user';
|
||||
|
|
Loading…
Reference in a new issue