Changed preg_match() code in Player username handling

This commit is contained in:
Shoghi Cervantes 2014-02-19 00:48:54 +01:00
parent a1b2cf4b34
commit 3d3111fef6

View File

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