Bypass possible server-side bug

This commit is contained in:
Daniil Gentili 2019-06-05 22:01:11 +02:00
parent c71dd59f87
commit a4e25ecfa2
2 changed files with 3 additions and 2 deletions

View File

@ -114,7 +114,7 @@ trait CallHandler
if (isset($args['multiple'])) {
$aargs['multiple'] = true;
}
if (isset($args['message']) && is_string($args['message']) && mb_strlen($args['message'], 'UTF-8') > $this->config['message_length_max']) {
if (isset($args['message']) && is_string($args['message']) && mb_strlen($args['message'], 'UTF-8') > $this->config['message_length_max'] && mb_strlen((yield $this->parse_mode_async($args))['message'], 'UTF-8') > $this->config['message_length_max']) {
$args = yield $this->split_to_chunks_async($args);
$promises = [];
$aargs['queue'] = $method;

View File

@ -504,7 +504,8 @@ trait BotAPI
if (stripos($arguments['parse_mode'], 'html') !== false) {
$new_message = '';
$arguments['message'] = rtrim($this->html_fixtags($arguments['message']));
$arguments['message'] = trim($this->html_fixtags($arguments['message']));
$dom = new \DOMDocument();
if (!extension_loaded('mbstring')) {
throw new \danog\MadelineProto\Exception(['extension', 'mbstring']);