From 86b40e016a4d9d00f9897fb92afa2cbe48977cf8 Mon Sep 17 00:00:00 2001 From: Juhani Haverinen Date: Tue, 18 Mar 2014 18:01:46 +0200 Subject: [PATCH] Prevent outsider from sending ANSI escape codes --- ircbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ircbot.py b/ircbot.py index 98f3075..0acda49 100755 --- a/ircbot.py +++ b/ircbot.py @@ -130,7 +130,7 @@ class Loghandler(threading.Thread): while True: s=self.inpc.recv() if s=='QUIT': break - sys.stdout.write(s) + sys.stdout.write(s.replace('\x1b','^[')) class Threadwrapper(threading.Thread): def __init__(self,func,arg):