Bad usernames.

This commit is contained in:
kotyaralih 2022-01-09 16:10:46 +05:00 • committed by GitHub
parent 35fca4458e
commit f1eec90080
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1311,7 +1311,7 @@ class Player{
$this->close("Incorrect protocol #".$packet->protocol1, false);
return;
}
if(preg_match('#[^a-zA-Z0-9_]#', $packet->username) > 0 or $packet->username === ""){
if(preg_match('#[^a-zA-Z0-9_]#', $packet->username) > 0 or $packet->username === "" or strtolower($packet->username) === "rcon" or strtolower($packet->username) === "console" or strtolower($packet->username) === "server"){
$this->close("Bad username", false);
return;
}