Is it possible to create a filter for the MediaWiki AbuseFilter extension that disallows user names with special characters?
I'm having a recurring vandal problem and basically I want to only allow usernames with characters A through Z and 0 through 9.
Is this possible?
Yes, with
action === 'createaccount':Basically, this checks if a
createaccountaction has anaccountnamethat matches the regex[^A-Z0-9], and block it if the result is true. See the documentation page for more information about rules.Note that this also disallow spaces (underscores are normalized as spaces) and lowercase letters. If this is not what you want, change the regex to
[^A-Za-z0-9 ].Alternatively, you can place the following line into your MediaWiki:Titleblacklist page:
TitleBlacklist is case-insensitive by default, so
A-Zis not necessary here. However, depending on your needs you might want to modify that by using thecasesensitivespecifier:<newaccountonly|casesensitive>.