From c1e1f5195bebdd477620b6ff7a573195b09e854f Mon Sep 17 00:00:00 2001 From: williamtdr Date: Wed, 31 Jul 2013 16:45:56 -0500 Subject: [PATCH] Fix for players connecting with a blank username field Fix for players connecting with a blank username field (#636). --- src/Player.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Player.php b/src/Player.php index 55a32bf5..467eeab8 100644 --- a/src/Player.php +++ b/src/Player.php @@ -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{