Fixed username regex failing, close #427

This commit is contained in:
Dylan K. Taylor 2017-03-15 19:22:43 +00:00
parent bb85308b01
commit b7b73aab23

View File

@ -216,7 +216,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
public static function isValidUserName(string $name) : bool{ public static function isValidUserName(string $name) : bool{
$lname = strtolower($name); $lname = strtolower($name);
$len = strlen($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;
} }
/** /**