Skip to content

Commit 87eaa3a

Browse files
author
Clément
committed
[NotifierBridge] Escaped '.' for telegram transport
Hello, The MarkdownV2 parse mode has the '.' char as a reserved char. It should be escaped but only on this parse mode
1 parent 09ef709 commit 87eaa3a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/Notifier/Bridge/Telegram/TelegramTransport.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ protected function doSend(MessageInterface $message): SentMessage
7979

8080
$options['text'] = $message->getSubject();
8181

82-
if (!isset($options['parse_mode'])) {
82+
if (!isset($options['parse_mode']) || $options['parse_mode'] == TelegramOptions::PARSE_MODE_MARKDOWN_V2) {
8383
$options['parse_mode'] = TelegramOptions::PARSE_MODE_MARKDOWN_V2;
84+
$options['text'] = str_replace('.', '\.', $message->getSubject());
8485
}
8586

8687
$response = $this->client->request('POST', $endpoint, [

0 commit comments

Comments
 (0)