Protected the server against non-standard characters on input line; this would give traceback or weird results before.
/Griatch
This commit is contained in:
parent
656ecd9f97
commit
3614960471
1 changed files with 6 additions and 0 deletions
|
|
@ -78,6 +78,12 @@ class SessionProtocol(StatefulTelnetProtocol):
|
||||||
Any line return indicates a command for the purpose of a MUD. So we take
|
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.
|
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:
|
if self.pobject:
|
||||||
# Session is logged in, run through the normal object execution.
|
# Session is logged in, run through the normal object execution.
|
||||||
self.pobject.execute_cmd(data, session=self)
|
self.pobject.execute_cmd(data, session=self)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue