mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added fix for escaping underscore while using Markdown (#11070)
* Added fix for escaping underscore while using Markdown * Corrected indentation
This commit is contained in:
@@ -44,6 +44,9 @@ class Telegram extends Transport
|
||||
$format="";
|
||||
if ($data['format']) {
|
||||
$format="&parse_mode=" . $data['format'];
|
||||
if ($data['format'] == 'Markdown') {
|
||||
$text = urlencode(preg_replace("/([a-z0-9]+)_([a-z0-9]+)/", "$1\_$2", $obj['msg']));
|
||||
}
|
||||
}
|
||||
curl_setopt($curl, CURLOPT_URL, ("https://api.telegram.org/bot{$data['token']}/sendMessage?chat_id={$data['chat_id']}&text=$text{$format}"));
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
||||
|
Reference in New Issue
Block a user