Skip to content

Commit bd4a9ba

Browse files
committed
Remove obsolete characters and revert change to Exception message.
1 parent 2bac318 commit bd4a9ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function doSend(MessageInterface $message): SentMessage
8282

8383
if (!isset($options['parse_mode']) || TelegramOptions::PARSE_MODE_MARKDOWN_V2 === $options['parse_mode']) {
8484
$options['parse_mode'] = TelegramOptions::PARSE_MODE_MARKDOWN_V2;
85-
$options['text'] = preg_replace('/([\[_\*\[\]\(\)~`>#\+-=\|{}\.!])/m', '\\\\$1', $message->getSubject());
85+
$options['text'] = preg_replace('/([_*\[\]()~`>#+\-=|{}.!])/', '\\\\$1', $message->getSubject());
8686
}
8787

8888
$response = $this->client->request('POST', $endpoint, [
@@ -98,7 +98,7 @@ protected function doSend(MessageInterface $message): SentMessage
9898
if (200 !== $statusCode) {
9999
$result = $response->toArray(false);
100100

101-
throw new TransportException('Unable to post the Telegram message: '.$result['description'].sprintf(' (code "%s").', $result['error_code']), $response);
101+
throw new TransportException('Unable to post the Telegram message: '.$result['description'].sprintf(' (code %s).', $result['error_code']), $response);
102102
}
103103

104104
$success = $response->toArray(false);

0 commit comments

Comments
 (0)