fix: escape Telegram Markdown special characters

This commit is contained in:
xboard committed 2026-03-30 01:46:56 +08:00
1 parent 7cd1fb185b
commit dbfb2f1376
2 files changed
+15 -5

No files matched your search

+10
View File
@@ -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);
}
}