disallow control chars in player nicks, thanks for burp to helping making the list more complete
authorsheepluva
Wed, 22 Jan 2014 23:52:21 +0100
changeset 10059 015ed10e7e66
parent 10058 4ed428389c4e
child 10060 bcf2e1ca2971
disallow control chars in player nicks, thanks for burp to helping making the list more complete
gameServer/Utils.hs
--- a/gameServer/Utils.hs	Thu Jan 23 01:04:17 2014 +0400
+++ b/gameServer/Utils.hs	Wed Jan 22 23:52:21 2014 +0100
@@ -58,7 +58,7 @@
 illegalName :: B.ByteString -> Bool
 illegalName s = B.null s || B.length s > 40 || B.all isSpace s || isSpace (B.head s) || isSpace (B.last s) || B.any isIllegalChar s
     where
-        isIllegalChar c = c `List.elem` "$()*+?[]^{|}"
+        isIllegalChar c = c `List.elem` ("$()*+?[]^{|}" ++ ['\x00'..'\x1F'] ++ ['\x7F'..'\x9F'])
 
 protoNumber2ver :: Word16 -> B.ByteString
 protoNumber2ver v = Map.findWithDefault "Unknown" v vermap