mirror of
https://github.com/PaiGramTeam/telegram-bot-api.git
synced 2024-11-29 11:03:14 +00:00
Fail request early if message/caption/explanation text is too long.
This commit is contained in:
parent
1ec733a3f8
commit
df1fe4c05f
@ -7240,6 +7240,10 @@ td::Result<td_api::object_ptr<td_api::textEntity>> Client::get_text_entity(td::J
|
||||
|
||||
td::Result<td_api::object_ptr<td_api::formattedText>> Client::get_formatted_text(td::string text, td::string parse_mode,
|
||||
td::JsonValue &&input_entities) {
|
||||
if (text.size() > (1 << 15)) {
|
||||
return td::Status::Error(400, "Text is too long");
|
||||
}
|
||||
|
||||
td::to_lower_inplace(parse_mode);
|
||||
if (!text.empty() && !parse_mode.empty() && parse_mode != "none") {
|
||||
object_ptr<td_api::TextParseMode> text_parse_mode;
|
||||
|
Loading…
Reference in New Issue
Block a user