mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 19:59:11 +00:00
Changed preg_match() code in Player username handling
This commit is contained in:
@@ -1326,7 +1326,7 @@ class Player{
|
|||||||
$this->close("Incorrect protocol #".$packet->protocol1, false);
|
$this->close("Incorrect protocol #".$packet->protocol1, false);
|
||||||
return;
|
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);
|
$this->close("Bad username", false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user