mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-03 10:30:51 +08:00
fix: escape Telegram Markdown special characters
This commit is contained in:
@@ -229,4 +229,14 @@ class Helper
|
||||
{
|
||||
return $transfer_enable / 1073741824;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转义 Telegram Markdown 特殊字符
|
||||
* @param string $text
|
||||
* @return string
|
||||
*/
|
||||
public static function escapeMarkdown(string $text): string
|
||||
{
|
||||
return str_replace(['_', '*', '`', '['], ['\_', '\*', '\`', '\['], $text);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user