mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Fixed username regex failing, close #427
This commit is contained in:
@ -216,7 +216,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
public static function isValidUserName(string $name) : bool{
|
||||
$lname = strtolower($name);
|
||||
$len = strlen($name);
|
||||
return $lname !== "rcon" and $lname !== "console" and $len >= 1 and $len <= 16 and preg_match("[^A-Za-z0-9_]", $name) === 0;
|
||||
return $lname !== "rcon" and $lname !== "console" and $len >= 1 and $len <= 16 and preg_match("/[^A-Za-z0-9_]/", $name) === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user