From 9bbdf70e69182c9677152bc69109a5992700192e Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 27 Nov 2022 01:50:46 +0300 Subject: Fix telegram attachment comment formatting and escaping (#1920) --- bridge/telegram/handlers.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bridge/telegram/handlers.go') diff --git a/bridge/telegram/handlers.go b/bridge/telegram/handlers.go index ad41354e..b9cc7e6f 100644 --- a/bridge/telegram/handlers.go +++ b/bridge/telegram/handlers.go @@ -451,6 +451,11 @@ func (b *Btelegram) handleUploadFile(msg *config.Message, chatid int64, parentID Name: fi.Name, Bytes: *fi.Data, } + + if b.GetString("MessageFormat") == HTMLFormat { + fi.Comment = makeHTML(html.EscapeString(fi.Comment)) + } + switch filepath.Ext(fi.Name) { case ".jpg", ".jpe", ".png": pc := tgbotapi.NewInputMediaPhoto(file) -- cgit v1.2.3