Fix for players connecting with a blank username field

Fix for players connecting with a blank username field (#636).
This commit is contained in:
williamtdr 2013-07-31 16:45:56 -05:00
parent a60d41d489
commit c1e1f5195b

View File

@ -1053,7 +1053,7 @@ class Player{
$this->close("Incorrect protocol #".$data["protocol1"], false);
break;
}
if(preg_match('#[^a-zA-Z0-9_]#', $data["username"]) == 0){
if(preg_match('#[^a-zA-Z0-9_]#', $data["username"]) == 0 && $data["username"] != ""){
$this->username = $data["username"];
$this->iusername = strtolower($this->username);
}else{