mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-12 12:55:21 +00:00
Changed preg_match() code in Player username handling
This commit is contained in:
parent
a1b2cf4b34
commit
3d3111fef6
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user