home
·
contact
·
privacy
projects
/
plomrogue2
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
089f09f
)
Whitelist legal input characters.
author
Christian Heller
<c.heller@plomlompom.de>
Sat, 5 Dec 2020 11:00:43 +0000
(12:00 +0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Sat, 5 Dec 2020 11:00:43 +0000
(12:00 +0100)
plomrogue/parser.py
patch
|
blob
|
history
diff --git
a/plomrogue/parser.py
b/plomrogue/parser.py
index 69f728ee9859f3ed299f04b98177687c0ee52ce0..2820c186778365384be548929c2a1128f587d490 100644
(file)
--- a/
plomrogue/parser.py
+++ b/
plomrogue/parser.py
@@
-78,6
+78,14
@@
class Parser:
Respects function signature defined in function's .argtypes attribute.
"""
+ import string
+ msg = msg.rstrip()
+ legal_chars = string.digits + string.ascii_letters +\
+ string.punctuation + ' ' + 'ÄäÖöÜüߧ' + 'éèáàô'
+ for c in msg:
+ if not c in legal_chars:
+ raise ArgError('Command/message contains illegal character(s), '
+ 'may only contain ones of: %s' % legal_chars)
tokens = self.tokenize(msg)
if len(tokens) == 0:
return None, ()