From eb7d90bb00d9c34ca02e3f3e3e31ea597f7947c6 Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 6 Jun 2019 09:29:17 +0100 Subject: [PATCH] message_tag_escape() message-tag values when .format()ing IRCLine --- src/IRCLine.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/IRCLine.py b/src/IRCLine.py index 2a52bf23..6bd50e75 100644 --- a/src/IRCLine.py +++ b/src/IRCLine.py @@ -1,5 +1,5 @@ import datetime, typing -from src import IRCObject +from src import IRCObject, utils # this should be 510 (RFC1459, 512 with \r\n) but a server BitBot uses is broken LINE_CUTOFF = 470 @@ -56,7 +56,8 @@ class ParsedLine(object): tag_pieces = [] for tag, value in tags.items(): if value: - tag_pieces.append("%s=%s" % (tag, value)) + value_escaped = utils.irc.message_tag_escape(value) + tag_pieces.append("%s=%s" % (tag, value_escaped)) else: tag_pieces.append(tag)