1
0
Fork 0
forked from mirror/pixelfed

Update FixUsernames.php

Should allow to fix registered usernames that are are restricted, even if they are in a different case.

Examples : "ADmiN" , "Logout", "Help", "FollowMe"
This commit is contained in:
Hervé Yvis 2020-11-26 18:30:40 +01:00 committed by GitHub
parent 78a8798ace
commit 37cddf740c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,7 +57,7 @@ class FixUsernames extends Command
if($user->is_admin || $user->status == 'deleted') {
continue;
}
if(in_array($user->username, $restricted)) {
if(in_array(strtolower($user->username), array_map('strtolower', $restricted))) {
$affected->push($user);
}
$val = str_replace(['-', '_', '.'], '', $user->username);