Protected the server against non-standard characters on input line; this would give traceback or weird results before.

/Griatch
This commit is contained in:
Griatch 2009-10-22 20:10:31 +00:00
parent 656ecd9f97
commit 3614960471

View file

@ -78,6 +78,12 @@ class SessionProtocol(StatefulTelnetProtocol):
Any line return indicates a command for the purpose of a MUD. So we take
the user input and pass it to this session's pobject.
"""
try:
data = u"%s" % data
except UnicodeDecodeError:
self.msg("Couldn't parse that. You put some non-standard characters in there.")
return
if self.pobject:
# Session is logged in, run through the normal object execution.
self.pobject.execute_cmd(data, session=self)