Skip to content

Commit 94f7d78

Browse files
committed
Fix unescaping of charcaters in corrected messages
1 parent 7f6f9fc commit 94f7d78

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

plugins/correction.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@ def correction(match, conn, nick, chan, message):
3838
mod_msg = msg
3939
fmt = "<{}> {}"
4040

41-
mod_msg = ireplace(mod_msg, find_esc, "\x02" + replace_esc + "\x02")
41+
mod_msg = ireplace(re.escape(mod_msg), find_esc, "\x02" + replace_esc + "\x02")
42+
43+
mod_msg = unescape_re.sub(r"\1", mod_msg)
4244

4345
message("Correction, {}".format(fmt.format(name, mod_msg)))
4446

45-
msg = ireplace(msg, find_esc, replace_esc)
4647
if nick.lower() == name.lower():
48+
msg = ireplace(re.escape(msg), find_esc, replace_esc)
49+
msg = unescape_re.sub(r"\1", msg)
4750
conn.history[chan].append((name, timestamp, msg))
4851

4952
break

0 commit comments

Comments
 (0)