Disallow isSpace chars at start and end of nicknames and room names 0.9.15
authorunc0rr
Sat, 22 Jan 2011 22:35:53 +0300
branch0.9.15
changeset 4768 d00562929f28
parent 4765 adef9ec50d63
child 4771 6bb64d38003e
Disallow isSpace chars at start and end of nicknames and room names
gameServer/Utils.hs
--- a/gameServer/Utils.hs	Sat Jan 22 01:38:01 2011 +0100
+++ b/gameServer/Utils.hs	Sat Jan 22 22:35:53 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"