Skip to content

Commit a0ce5cc

Browse files
committed
replace: Escape output text
1 parent 3739e1c commit a0ce5cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

plugin/replace/replace.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ func onReplace(b *gotgbot.Bot, c plugin.GobotContext) error {
5959
}
6060

6161
text = strings.ReplaceAll(text, c.Matches[1], replacement)
62+
text = utils.Escape(text)
6263

6364
_, err := c.EffectiveMessage.ReplyToMessage.Reply(b, "<b>Du meintest wohl:</b>\n"+text, &gotgbot.SendMessageOpts{
6465
ReplyParameters: &gotgbot.ReplyParameters{
@@ -98,6 +99,8 @@ func onRegexReplace(b *gotgbot.Bot, c plugin.GobotContext) error {
9899
}
99100

100101
text = re.ReplaceAllString(text, c.Matches[2])
102+
text = utils.Escape(text)
103+
101104
_, err = c.EffectiveMessage.ReplyToMessage.Reply(b, "<b>Du meintest wohl:</b>\n"+text, utils.DefaultSendOptions())
102105
return err
103106
}

0 commit comments

Comments
 (0)