mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 20:49:43 +00:00
Real Minecraft username check
This commit is contained in:
parent
ba3dfd91db
commit
5fab555c48
1 changed files with 4 additions and 4 deletions
|
|
@ -529,10 +529,10 @@ class Player{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$this->loggedIn = true;
|
$this->loggedIn = true;
|
||||||
$this->username = str_replace(array("\x00", "/", " ", "\r", "\n", '"', "'"), array("", "-", "_", "", "", "", ""), $data["username"]);
|
if(preg_match('#^[a-zA-Z0-9_]{2,16}$#', $data["username"])){
|
||||||
$this->iusername = strtolower($this->username);
|
$this->username = $data["username"];
|
||||||
|
$this->iusername = strtolower($this->username);
|
||||||
if($this->username == ""){
|
}else{
|
||||||
$this->close("bad username", false);
|
$this->close("bad username", false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue