tag: sanitize inputs

This commit is contained in:
Ryan Hitchman 2014-05-01 21:45:37 -07:00
parent 1d7a82fe58
commit 0a84f84e57
1 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,10 @@ import threading
from util import hook
def sanitize(s):
return re.sub(r'[\x00-\x1f]', '', s)
@hook.command
def munge(inp, munge_count=0):
reps = 0
@ -150,7 +154,7 @@ def tag(inp, chan='', db=None):
return 'tag syntax has changed. try .tags or .tagged instead'
elif nick.lower() == 'del':
return 'tag syntax has changed. try ".untag %s" instead' % subject
return add_tag(db, chan, nick, subject)
return add_tag(db, chan, sanitize(nick), sanitize(subject))
else:
tags = get_tags_by_nick(db, chan, inp)
if tags: