Disallow isSpace chars at start and end of nicknames and room names
authorunc0rr
Sat, 22 Jan 2011 22:37:12 +0300
changeset 4866 64572716e097
parent 4865 3a48fbc4a281
child 4868 652139f230c7
Disallow isSpace chars at start and end of nicknames and room names
gameServer/Utils.hs
--- a/gameServer/Utils.hs	Fri Jan 21 17:07:42 2011 -0500
+++ b/gameServer/Utils.hs	Sat Jan 22 22:37:12 2011 +0300
@@ -91,7 +91,7 @@
             t : replaceTeam team teams
 
 illegalName :: String -> Bool
-illegalName = all isSpace
+illegalName s = null s || all isSpace s || isSpace (head s) || isSpace (last s)
 
 protoNumber2ver :: Word16 -> String
 protoNumber2ver 17 = "0.9.7-dev"